diff --git a/YACReader/bookmarks_dialog.cpp b/YACReader/bookmarks_dialog.cpp index 33a1b939..70c3bfb4 100644 --- a/YACReader/bookmarks_dialog.cpp +++ b/YACReader/bookmarks_dialog.cpp @@ -17,10 +17,10 @@ BookmarksDialog::BookmarksDialog(QWidget *parent) //animation = new QPropertyAnimation(this,"windowOpacity"); //animation->setDuration(150); - QHBoxLayout *layout = new QHBoxLayout(); + auto layout = new QHBoxLayout(); //bookmarks - QGridLayout *bookmarksL = new QGridLayout(); + auto bookmarksL = new QGridLayout(); pages.push_back(new QLabel(tr("Lastest Page"))); for (int i = 0; i < 3; i++) @@ -55,17 +55,17 @@ BookmarksDialog::BookmarksDialog(QWidget *parent) bookmarksL->addWidget(images.at(i + 1), 1, i, Qt::AlignCenter); //last page - QGridLayout *lp = new QGridLayout(); + auto lp = new QGridLayout(); lp->addWidget(pages.at(0), 0, 0, Qt::AlignCenter); lp->addWidget(images.at(0), 1, 0, Qt::AlignCenter); layout->addLayout(bookmarksL); - QFrame *f = new QFrame(this); + auto f = new QFrame(this); f->setFrameStyle(QFrame::VLine | QFrame::Sunken); layout->addWidget(f); layout->addLayout(lp); - QHBoxLayout *buttons = new QHBoxLayout(); + auto buttons = new QHBoxLayout(); cancel = new QPushButton(tr("Close")); cancel->setFlat(true); @@ -75,7 +75,7 @@ BookmarksDialog::BookmarksDialog(QWidget *parent) cancel->setStyleSheet("QPushButton {border: 1px solid #242424; background: #2e2e2e; color:white; padding: 5px 26px 5px 26px; font-size:12px;font-family:Arial; font-weight:bold;}"); - QVBoxLayout *l = new QVBoxLayout(); + auto l = new QVBoxLayout(); l->addWidget(new QLabel("" + tr("Click on any image to go to the bookmark") + ""), 0, Qt::AlignCenter); l->addLayout(layout); diff --git a/YACReader/goto_dialog.cpp b/YACReader/goto_dialog.cpp index 7d0ce1af..a35cbde0 100644 --- a/YACReader/goto_dialog.cpp +++ b/YACReader/goto_dialog.cpp @@ -25,24 +25,24 @@ void GoToDialog::setupUI() cancel = new QPushButton(tr("Cancel")); connect(cancel, SIGNAL(clicked()), this, SLOT(close())); - QHBoxLayout *topLayout = new QHBoxLayout; + auto topLayout = new QHBoxLayout; topLayout->addWidget(textLabel); topLayout->addWidget(pageNumber); - QHBoxLayout *bottomLayout = new QHBoxLayout; + auto bottomLayout = new QHBoxLayout; bottomLayout->addStretch(); bottomLayout->addWidget(accept); bottomLayout->addWidget(cancel); - QVBoxLayout *mainLayout = new QVBoxLayout; + auto mainLayout = new QVBoxLayout; mainLayout->addWidget(numPagesLabel = new QLabel(tr("Total pages : "))); mainLayout->addLayout(topLayout); mainLayout->addStretch(); mainLayout->addLayout(bottomLayout); - QHBoxLayout *imgMainLayout = new QHBoxLayout; - QLabel *imgLabel = new QLabel(); + auto imgMainLayout = new QHBoxLayout; + auto imgLabel = new QLabel(); QPixmap p(":/images/goto.png"); imgLabel->setPixmap(p); imgMainLayout->addWidget(imgLabel); diff --git a/YACReader/goto_flow_toolbar.cpp b/YACReader/goto_flow_toolbar.cpp index 71df2ac0..b23c3f94 100644 --- a/YACReader/goto_flow_toolbar.cpp +++ b/YACReader/goto_flow_toolbar.cpp @@ -8,12 +8,12 @@ GoToFlowToolBar::GoToFlowToolBar(QWidget *parent) : QStackedWidget(parent) { //elementos interactivos - QWidget *normal = new QWidget(this); // container widget - QWidget *quickNavi = new QWidget(this); // container widget + auto normal = new QWidget(this); // container widget + auto quickNavi = new QWidget(this); // container widget addWidget(normal); addWidget(quickNavi); - QHBoxLayout *normalLayout = new QHBoxLayout(normal); - QHBoxLayout *naviLayout = new QHBoxLayout(quickNavi); + auto normalLayout = new QHBoxLayout(normal); + auto naviLayout = new QHBoxLayout(quickNavi); normal->setLayout(normalLayout); quickNavi->setLayout(naviLayout); diff --git a/YACReader/magnifying_glass.cpp b/YACReader/magnifying_glass.cpp index dfe9044f..e1b586ab 100644 --- a/YACReader/magnifying_glass.cpp +++ b/YACReader/magnifying_glass.cpp @@ -36,7 +36,7 @@ void MagnifyingGlass::updateImage(int x, int y) //image section augmented int zoomWidth = static_cast(width() * zoomLevel); int zoomHeight = static_cast(height() * zoomLevel); - Viewer *p = (Viewer *)parent(); + auto p = (Viewer *)parent(); int currentPos = p->verticalScrollBar()->sliderPosition(); const QPixmap *image = p->pixmap(); int iWidth = image->width(); @@ -186,7 +186,7 @@ void MagnifyingGlass::zoomOut() void MagnifyingGlass::sizeUp() { - Viewer *p = (Viewer *)parent(); + auto p = (Viewer *)parent(); if (width() < (p->width() * 0.90f)) resize(width() + 30, height() + 15); } @@ -199,7 +199,7 @@ void MagnifyingGlass::sizeDown() void MagnifyingGlass::heightUp() { - Viewer *p = (Viewer *)parent(); + auto p = (Viewer *)parent(); if (height() < (p->height() * 0.90f)) resize(width(), height() + 15); } @@ -212,7 +212,7 @@ void MagnifyingGlass::heightDown() void MagnifyingGlass::widthUp() { - Viewer *p = (Viewer *)parent(); + auto p = (Viewer *)parent(); if (width() < (p->width() * 0.90f)) resize(width() + 30, height()); } diff --git a/YACReader/main.cpp b/YACReader/main.cpp index 8194b701..858b5e66 100644 --- a/YACReader/main.cpp +++ b/YACReader/main.cpp @@ -118,7 +118,7 @@ int main(int argc, char *argv[]) translator.load(QCoreApplication::applicationDirPath() + "/languages/yacreader_" + sufix); #endif app.installTranslator(&translator); - MainWindowViewer *mwv = new MainWindowViewer(); + auto mwv = new MainWindowViewer(); // some arguments need to be parsed after MainWindowViewer creation QStringList arglist = parser.positionalArguments(); diff --git a/YACReader/main_window_viewer.cpp b/YACReader/main_window_viewer.cpp index f618e955..0ddd901e 100644 --- a/YACReader/main_window_viewer.cpp +++ b/YACReader/main_window_viewer.cpp @@ -317,7 +317,7 @@ void MainWindowViewer::createActions() connect(fitToPageAction, SIGNAL(triggered()), this, SLOT(fitToPageSwitch())); //fit modes have to be exclusive and checkable - QActionGroup *fitModes = new QActionGroup(this); + auto fitModes = new QActionGroup(this); fitModes->addAction(adjustHeightAction); fitModes->addAction(adjustWidthAction); fitModes->addAction(adjustToFullSizeAction); @@ -518,13 +518,13 @@ void MainWindowViewer::createToolBars() comicToolBar->addAction(openAction); comicToolBar->addAction(openFolderAction); #else - QMenu *recentmenu = new QMenu(tr("Open recent")); + auto recentmenu = new QMenu(tr("Open recent")); recentmenu->addActions(recentFilesActionList); recentmenu->addSeparator(); recentmenu->addAction(clearRecentFilesAction); refreshRecentFilesActionList(); - QToolButton *tb = new QToolButton(); + auto tb = new QToolButton(); tb->addAction(openAction); tb->addAction(openLatestComicAction); tb->addAction(openFolderAction); @@ -643,12 +643,12 @@ void MainWindowViewer::createToolBars() //MacOSX app menus #ifdef Q_OS_MAC - QMenuBar *menuBar = this->menuBar(); + auto menuBar = this->menuBar(); //about / preferences //TODO //file - QMenu *fileMenu = new QMenu(tr("File")); + auto fileMenu = new QMenu(tr("File")); fileMenu->addAction(openAction); fileMenu->addAction(openLatestComicAction); @@ -657,7 +657,7 @@ void MainWindowViewer::createToolBars() fileMenu->addAction(saveImageAction); fileMenu->addSeparator(); - QMenu *recentmenu = new QMenu(tr("Open recent")); + auto recentmenu = new QMenu(tr("Open recent")); recentmenu->addActions(recentFilesActionList); recentmenu->addSeparator(); recentmenu->addAction(clearRecentFilesAction); @@ -667,11 +667,11 @@ void MainWindowViewer::createToolBars() fileMenu->addSeparator(); fileMenu->addAction(closeAction); - QMenu *editMenu = new QMenu(tr("Edit")); + auto editMenu = new QMenu(tr("Edit")); editMenu->addAction(leftRotationAction); editMenu->addAction(rightRotationAction); - QMenu *viewMenu = new QMenu(tr("View")); + auto viewMenu = new QMenu(tr("View")); viewMenu->addAction(adjustHeightAction); viewMenu->addAction(adjustWidthAction); viewMenu->addAction(fitToPageAction); @@ -687,7 +687,7 @@ void MainWindowViewer::createToolBars() viewMenu->addSeparator(); viewMenu->addAction(showMagnifyingGlassAction); - QMenu *goMenu = new QMenu(tr("Go")); + auto goMenu = new QMenu(tr("Go")); goMenu->addAction(prevAction); goMenu->addAction(nextAction); goMenu->addAction(goToPageAction); @@ -695,14 +695,14 @@ void MainWindowViewer::createToolBars() goMenu->addAction(setBookmarkAction); goMenu->addAction(showBookmarksAction); - QMenu *windowMenu = new QMenu(tr("Window")); + auto windowMenu = new QMenu(tr("Window")); windowMenu->addAction(optionsAction); // this action goes to MacOS's Preference menu by Qt windowMenu->addAction(showShorcutsAction); windowMenu->addAction(showFlowAction); windowMenu->addAction(showInfoAction); windowMenu->addAction(showDictionaryAction); - QMenu *helpMenu = new QMenu(tr("Help")); + auto helpMenu = new QMenu(tr("Help")); helpMenu->addAction(helpAboutAction); menuBar->addMenu(fileMenu); @@ -754,7 +754,7 @@ void MainWindowViewer::clearRecentFiles() void MainWindowViewer::openRecent() { - QAction *action = qobject_cast(sender()); + auto *action = qobject_cast(sender()); openComicFromRecentAction(action); } @@ -1199,7 +1199,7 @@ void MainWindowViewer::checkNewVersion() connect(versionChecker, SIGNAL(newVersionDetected()), this, SLOT(newVersion())); - QTimer *tT = new QTimer; + auto tT = new QTimer; tT->setSingleShot(true); connect(tT, SIGNAL(timeout()), versionChecker, SLOT(get())); //versionChecker->get(); //TOD� @@ -1227,7 +1227,7 @@ void MainWindowViewer::processReset() void MainWindowViewer::setUpShortcutsManagement() { //actions holder - QObject *orphanActions = new QObject; + auto orphanActions = new QObject; QList allActions; QList tmpList; @@ -1267,19 +1267,19 @@ void MainWindowViewer::setUpShortcutsManagement() allActions << tmpList; //keys without actions (MGlass) - QAction *sizeUpMglassAction = new QAction(tr("Size up magnifying glass"), orphanActions); + auto sizeUpMglassAction = new QAction(tr("Size up magnifying glass"), orphanActions); sizeUpMglassAction->setData(SIZE_UP_MGLASS_ACTION_Y); sizeUpMglassAction->setShortcut(ShortcutsManager::getShortcutsManager().getShortcut(SIZE_UP_MGLASS_ACTION_Y)); - QAction *sizeDownMglassAction = new QAction(tr("Size down magnifying glass"), orphanActions); + auto sizeDownMglassAction = new QAction(tr("Size down magnifying glass"), orphanActions); sizeDownMglassAction->setData(SIZE_DOWN_MGLASS_ACTION_Y); sizeDownMglassAction->setShortcut(ShortcutsManager::getShortcutsManager().getShortcut(SIZE_DOWN_MGLASS_ACTION_Y)); - QAction *zoomInMglassAction = new QAction(tr("Zoom in magnifying glass"), orphanActions); + auto zoomInMglassAction = new QAction(tr("Zoom in magnifying glass"), orphanActions); zoomInMglassAction->setData(ZOOM_IN_MGLASS_ACTION_Y); zoomInMglassAction->setShortcut(ShortcutsManager::getShortcutsManager().getShortcut(ZOOM_IN_MGLASS_ACTION_Y)); - QAction *zoomOutMglassAction = new QAction(tr("Zoom out magnifying glass"), orphanActions); + auto zoomOutMglassAction = new QAction(tr("Zoom out magnifying glass"), orphanActions); zoomOutMglassAction->setData(ZOOM_OUT_MGLASS_ACTION_Y); zoomOutMglassAction->setShortcut(ShortcutsManager::getShortcutsManager().getShortcut(ZOOM_OUT_MGLASS_ACTION_Y)); @@ -1294,7 +1294,7 @@ void MainWindowViewer::setUpShortcutsManagement() allActions << tmpList; //keys without actions - QAction *toggleFitToScreenAction = new QAction(tr("Toggle between fit to width and fit to height"), orphanActions); + auto toggleFitToScreenAction = new QAction(tr("Toggle between fit to width and fit to height"), orphanActions); toggleFitToScreenAction->setData(CHANGE_FIT_ACTION_Y); toggleFitToScreenAction->setShortcut(ShortcutsManager::getShortcutsManager().getShortcut(CHANGE_FIT_ACTION_Y)); @@ -1314,51 +1314,51 @@ void MainWindowViewer::setUpShortcutsManagement() allActions << tmpList; - QAction *autoScrollForwardAction = new QAction(tr("Autoscroll down"), orphanActions); + auto autoScrollForwardAction = new QAction(tr("Autoscroll down"), orphanActions); autoScrollForwardAction->setData(AUTO_SCROLL_FORWARD_ACTION_Y); autoScrollForwardAction->setShortcut(ShortcutsManager::getShortcutsManager().getShortcut(AUTO_SCROLL_FORWARD_ACTION_Y)); - QAction *autoScrollBackwardAction = new QAction(tr("Autoscroll up"), orphanActions); + auto autoScrollBackwardAction = new QAction(tr("Autoscroll up"), orphanActions); autoScrollBackwardAction->setData(AUTO_SCROLL_BACKWARD_ACTION_Y); autoScrollBackwardAction->setShortcut(ShortcutsManager::getShortcutsManager().getShortcut(AUTO_SCROLL_BACKWARD_ACTION_Y)); - QAction *autoScrollForwardHorizontalFirstAction = new QAction(tr("Autoscroll forward, horizontal first"), orphanActions); + auto autoScrollForwardHorizontalFirstAction = new QAction(tr("Autoscroll forward, horizontal first"), orphanActions); autoScrollForwardHorizontalFirstAction->setData(AUTO_SCROLL_FORWARD_HORIZONTAL_FIRST_ACTION_Y); autoScrollForwardHorizontalFirstAction->setShortcut(ShortcutsManager::getShortcutsManager().getShortcut(AUTO_SCROLL_FORWARD_HORIZONTAL_FIRST_ACTION_Y)); - QAction *autoScrollBackwardHorizontalFirstAction = new QAction(tr("Autoscroll backward, horizontal first"), orphanActions); + auto autoScrollBackwardHorizontalFirstAction = new QAction(tr("Autoscroll backward, horizontal first"), orphanActions); autoScrollBackwardHorizontalFirstAction->setData(AUTO_SCROLL_BACKWARD_HORIZONTAL_FIRST_ACTION_Y); autoScrollBackwardHorizontalFirstAction->setShortcut(ShortcutsManager::getShortcutsManager().getShortcut(AUTO_SCROLL_BACKWARD_HORIZONTAL_FIRST_ACTION_Y)); - QAction *autoScrollForwardVerticalFirstAction = new QAction(tr("Autoscroll forward, vertical first"), orphanActions); + auto autoScrollForwardVerticalFirstAction = new QAction(tr("Autoscroll forward, vertical first"), orphanActions); autoScrollForwardVerticalFirstAction->setData(AUTO_SCROLL_FORWARD_VERTICAL_FIRST_ACTION_Y); autoScrollForwardVerticalFirstAction->setShortcut(ShortcutsManager::getShortcutsManager().getShortcut(AUTO_SCROLL_FORWARD_VERTICAL_FIRST_ACTION_Y)); - QAction *autoScrollBackwardVerticalFirstAction = new QAction(tr("Autoscroll backward, vertical first"), orphanActions); + auto autoScrollBackwardVerticalFirstAction = new QAction(tr("Autoscroll backward, vertical first"), orphanActions); autoScrollBackwardVerticalFirstAction->setData(AUTO_SCROLL_BACKWARD_VERTICAL_FIRST_ACTION_Y); autoScrollBackwardVerticalFirstAction->setShortcut(ShortcutsManager::getShortcutsManager().getShortcut(AUTO_SCROLL_BACKWARD_VERTICAL_FIRST_ACTION_Y)); - QAction *moveDownAction = new QAction(tr("Move down"), orphanActions); + auto moveDownAction = new QAction(tr("Move down"), orphanActions); moveDownAction->setData(MOVE_DOWN_ACTION_Y); moveDownAction->setShortcut(ShortcutsManager::getShortcutsManager().getShortcut(MOVE_DOWN_ACTION_Y)); - QAction *moveUpAction = new QAction(tr("Move up"), orphanActions); + auto moveUpAction = new QAction(tr("Move up"), orphanActions); moveUpAction->setData(MOVE_UP_ACTION_Y); moveUpAction->setShortcut(ShortcutsManager::getShortcutsManager().getShortcut(MOVE_UP_ACTION_Y)); - QAction *moveLeftAction = new QAction(tr("Move left"), orphanActions); + auto moveLeftAction = new QAction(tr("Move left"), orphanActions); moveLeftAction->setData(MOVE_LEFT_ACTION_Y); moveLeftAction->setShortcut(ShortcutsManager::getShortcutsManager().getShortcut(MOVE_LEFT_ACTION_Y)); - QAction *moveRightAction = new QAction(tr("Move right"), orphanActions); + auto moveRightAction = new QAction(tr("Move right"), orphanActions); moveRightAction->setData(MOVE_RIGHT_ACTION_Y); moveRightAction->setShortcut(ShortcutsManager::getShortcutsManager().getShortcut(MOVE_RIGHT_ACTION_Y)); - QAction *goToFirstPageAction = new QAction(tr("Go to the first page"), orphanActions); + auto goToFirstPageAction = new QAction(tr("Go to the first page"), orphanActions); goToFirstPageAction->setData(GO_TO_FIRST_PAGE_ACTION_Y); goToFirstPageAction->setShortcut(ShortcutsManager::getShortcutsManager().getShortcut(GO_TO_FIRST_PAGE_ACTION_Y)); - QAction *goToLastPageAction = new QAction(tr("Go to the last page"), orphanActions); + auto goToLastPageAction = new QAction(tr("Go to the last page"), orphanActions); goToLastPageAction->setData(GO_TO_LAST_PAGE_ACTION_Y); goToLastPageAction->setShortcut(ShortcutsManager::getShortcutsManager().getShortcut(GO_TO_LAST_PAGE_ACTION_Y)); @@ -1634,7 +1634,7 @@ void MainWindowViewer::decreasePageZoomLevel() void MainWindowViewer::sendComic() { - YACReaderLocalClient *client = new YACReaderLocalClient; + auto client = new YACReaderLocalClient; connect(client, &YACReaderLocalClient::finished, client, &YACReaderLocalClient::deleteLater); currentComicDB.info.lastTimeOpened = QDateTime::currentMSecsSinceEpoch() / 1000; diff --git a/YACReader/notifications_label_widget.cpp b/YACReader/notifications_label_widget.cpp index f804719d..5a55d50c 100644 --- a/YACReader/notifications_label_widget.cpp +++ b/YACReader/notifications_label_widget.cpp @@ -5,7 +5,7 @@ NotificationsLabelWidget::NotificationsLabelWidget(QWidget *parent) : QWidget(parent) { - QVBoxLayout *layout = new QVBoxLayout; + auto layout = new QVBoxLayout; layout->setSpacing(0); layout->setMargin(0); @@ -67,7 +67,7 @@ void NotificationsLabelWidget::setText(const QString &text) void NotificationsLabelWidget::updatePosition() { - QWidget *parent = dynamic_cast(this->parent()); + auto parent = dynamic_cast(this->parent()); if (parent == nullptr) { return; } diff --git a/YACReader/options_dialog.cpp b/YACReader/options_dialog.cpp index 0daa2540..14340876 100644 --- a/YACReader/options_dialog.cpp +++ b/YACReader/options_dialog.cpp @@ -23,17 +23,17 @@ OptionsDialog::OptionsDialog(QWidget *parent) : YACReaderOptionsDialog(parent) { - QTabWidget *tabWidget = new QTabWidget(); + auto tabWidget = new QTabWidget(); - QVBoxLayout *layout = new QVBoxLayout(this); + auto layout = new QVBoxLayout(this); QWidget *pageGeneral = new QWidget(); QWidget *pageFlow = new QWidget(); QWidget *pageImage = new QWidget(); - QVBoxLayout *layoutGeneral = new QVBoxLayout(); - QVBoxLayout *layoutFlow = new QVBoxLayout(); - QVBoxLayout *layoutImageV = new QVBoxLayout(); - QGridLayout *layoutImage = new QGridLayout(); + auto layoutGeneral = new QVBoxLayout(); + auto layoutFlow = new QVBoxLayout(); + auto layoutImageV = new QVBoxLayout(); + auto layoutImage = new QGridLayout(); QGroupBox *slideSizeBox = new QGroupBox(tr("\"Go to flow\" size")); //slideSizeLabel = new QLabel(,this); @@ -42,13 +42,13 @@ OptionsDialog::OptionsDialog(QWidget *parent) slideSize->setMaximum(350); slideSize->setPageStep(5); slideSize->setOrientation(Qt::Horizontal); - QHBoxLayout *slideLayout = new QHBoxLayout(); + auto slideLayout = new QHBoxLayout(); slideLayout->addWidget(slideSize); slideSizeBox->setLayout(slideLayout); QGroupBox *pathBox = new QGroupBox(tr("My comics path")); - QHBoxLayout *path = new QHBoxLayout(); + auto path = new QHBoxLayout(); path->addWidget(pathEdit = new QLineEdit()); path->addWidget(pathFindButton = new QPushButton(QIcon(":/images/find_folder.png"), "")); pathBox->setLayout(path); @@ -67,7 +67,7 @@ OptionsDialog::OptionsDialog(QWidget *parent) fitLayout->addWidget(fitToWidthRatioS); fitBox->setLayout(fitLayout);*/ - QHBoxLayout *colorSelection = new QHBoxLayout; + auto colorSelection = new QHBoxLayout; backgroundColor = new QLabel(); QPalette pal = backgroundColor->palette(); pal.setColor(backgroundColor->backgroundRole(), Qt::black); @@ -109,7 +109,7 @@ OptionsDialog::OptionsDialog(QWidget *parent) quickNavi = new QCheckBox(tr("Quick Navigation Mode")); disableShowOnMouseOver = new QCheckBox(tr("Disable mouse over activation")); - QHBoxLayout *buttons = new QHBoxLayout(); + auto buttons = new QHBoxLayout(); buttons->addStretch(); buttons->addWidget(new QLabel(tr("Restart is needed"))); buttons->addWidget(accept); diff --git a/YACReader/page_label_widget.cpp b/YACReader/page_label_widget.cpp index 9a1a8d6a..19271a39 100644 --- a/YACReader/page_label_widget.cpp +++ b/YACReader/page_label_widget.cpp @@ -11,7 +11,7 @@ PageLabelWidget::PageLabelWidget(QWidget *parent) int verticalRes = QApplication::desktop()->screenGeometry().height(); - QHBoxLayout *layout = new QHBoxLayout; + auto layout = new QHBoxLayout; layout->setMargin(0); setContentsMargins(0, 0, 0, 0); @@ -44,7 +44,7 @@ PageLabelWidget::PageLabelWidget(QWidget *parent) void PageLabelWidget::show() { if (this->pos().y() <= 0 && animation->state() != QPropertyAnimation::Running) { - QWidget *parent = dynamic_cast(this->parent()); + auto *parent = dynamic_cast(this->parent()); if (parent == nullptr) { return; } @@ -62,7 +62,7 @@ void PageLabelWidget::show() void PageLabelWidget::hide() { if (this->pos().y() >= 0 && animation->state() != QPropertyAnimation::Running) { - QWidget *parent = dynamic_cast(this->parent()); + auto *parent = dynamic_cast(this->parent()); if (parent == nullptr) { return; } @@ -87,7 +87,7 @@ void PageLabelWidget::paintEvent(QPaintEvent *) void PageLabelWidget::updatePosition() { - QWidget *parent = dynamic_cast(this->parent()); + auto *parent = dynamic_cast(this->parent()); if (parent == nullptr) { return; } diff --git a/YACReader/render.cpp b/YACReader/render.cpp index b50fd7e1..f89b6932 100644 --- a/YACReader/render.cpp +++ b/YACReader/render.cpp @@ -437,7 +437,7 @@ void Render::render() QPixmap *Render::getCurrentPage() { - QPixmap *page = new QPixmap(); + auto page = new QPixmap(); *page = page->fromImage(*buffer[currentPageBufferedIndex]); return page; } @@ -482,7 +482,7 @@ QPixmap *Render::getCurrentDoublePage() default: return nullptr; } - QPixmap *page = new QPixmap(totalWidth, totalHeight); + auto page = new QPixmap(totalWidth, totalHeight); QPainter painter(page); painter.drawImage(QRect(leftpage, leftsize), *buffer[currentPageBufferedIndex]); painter.drawImage(QRect(rightpage, rightsize), *buffer[currentPageBufferedIndex + 1]); @@ -532,7 +532,7 @@ QPixmap *Render::getCurrentDoubleMangaPage() default: return nullptr; } - QPixmap *page = new QPixmap(totalWidth, totalHeight); + auto page = new QPixmap(totalWidth, totalHeight); QPainter painter(page); painter.drawImage(QRect(rightpage, rightsize), *buffer[currentPageBufferedIndex]); painter.drawImage(QRect(leftpage, leftsize), *buffer[currentPageBufferedIndex + 1]); diff --git a/YACReader/shortcuts_dialog.cpp b/YACReader/shortcuts_dialog.cpp index 9e5afb67..4581d4e7 100644 --- a/YACReader/shortcuts_dialog.cpp +++ b/YACReader/shortcuts_dialog.cpp @@ -15,16 +15,16 @@ ShortcutsDialog::ShortcutsDialog(QWidget *parent) setWindowIcon(QIcon(":/images/shortcuts.png")); setWindowTitle(tr("YACReader keyboard shortcuts")); - QVBoxLayout *mainLayout = new QVBoxLayout; + auto mainLayout = new QVBoxLayout; close = new QPushButton(tr("Close")); connect(close, SIGNAL(clicked()), this, SLOT(close())); - QHBoxLayout *bottomLayout = new QHBoxLayout; + auto bottomLayout = new QHBoxLayout; bottomLayout->addStretch(); bottomLayout->addWidget(close); - QHBoxLayout *shortcutsLayout = new QHBoxLayout; + auto shortcutsLayout = new QHBoxLayout; shortcuts = new QTextEdit(); shortcuts->setFrameStyle(QFrame::NoFrame); diff --git a/YACReader/translator.cpp b/YACReader/translator.cpp index 5ab8308d..4ea873b2 100644 --- a/YACReader/translator.cpp +++ b/YACReader/translator.cpp @@ -53,13 +53,13 @@ YACReaderTranslator::YACReaderTranslator(QWidget *parent) p.setColor(QPalette::Window, QColor("#404040")); this->setPalette(p); - QVBoxLayout *layout = new QVBoxLayout(this); + auto layout = new QVBoxLayout(this); //TITLE BAR - QHBoxLayout *titleBar = new QHBoxLayout(); - QPushButton *close = new QPushButton(QIcon(QPixmap(":/images/close.png")), ""); + auto titleBar = new QHBoxLayout(); + auto close = new QPushButton(QIcon(QPixmap(":/images/close.png")), ""); close->setFlat(true); - QLabel *title = new QLabel(tr("YACReader translator")); + auto title = new QLabel(tr("YACReader translator")); title->setStyleSheet("QLabel {font-size:18px; font-family:Arial; color:white;}"); titleBar->addWidget(title); titleBar->addStretch(); @@ -81,7 +81,7 @@ YACReaderTranslator::YACReaderTranslator(QWidget *parent) text->setStyleSheet("QTextEdit{border:none;background:#2a2a2a;color:white; font-size:12px; padding:6px;}" + scrollBarStyle); //COMBOBOXES - QHBoxLayout *combos = new QHBoxLayout(); + auto combos = new QHBoxLayout(); from = new QComboBox(this); to = new QComboBox(this); QString comboBoxStyle = "QComboBox {border:none;background:#2a2a2a;color:white;font-size:12px;font-family:Arial;padding-left:8px;}" @@ -97,7 +97,7 @@ YACReaderTranslator::YACReaderTranslator(QWidget *parent) QLabel *arrow = new QLabel(this); QPixmap arrowPixmap(":/images/fromTo.png"); arrow->setPixmap(arrowPixmap); - QPushButton *searchButton = new QPushButton(this); + auto searchButton = new QPushButton(this); searchButton->setIcon(QIcon(":/images/translatorSearch.png")); searchButton->setStyleSheet("QPushButton {border:none; background:#2a2a2a;}"); searchButton->setFixedSize(22, 22); @@ -112,7 +112,7 @@ YACReaderTranslator::YACReaderTranslator(QWidget *parent) layout->addLayout(combos); //RESULTS - QHBoxLayout *resultsTitleLayout = new QHBoxLayout(); + auto resultsTitleLayout = new QHBoxLayout(); resultsTitle = new QLabel(tr("Translation")); resultsTitle->setStyleSheet("QLabel {font-family:Arial;font-size:14px;color:#e3e3e3;}"); speakButton = new QPushButton(this); @@ -130,7 +130,7 @@ YACReaderTranslator::YACReaderTranslator(QWidget *parent) resultText = new QLabel(); resultText->setWordWrap(true); resultText->setStyleSheet("QLabel {color:white;font-size:12px;}"); - resultText->setText("ñlkas lakj dflkaj lasd jflie lkajd fie kljads ijef lasei afsliej ljse f"); + resultText->setText(""); layout->addWidget(resultText); layout->addStretch(); diff --git a/YACReader/viewer.cpp b/YACReader/viewer.cpp index 4e57aced..33d207b1 100644 --- a/YACReader/viewer.cpp +++ b/YACReader/viewer.cpp @@ -161,7 +161,7 @@ void Viewer::createConnections() connect(goToFlow, SIGNAL(goToPage(unsigned int)), this, SLOT(goTo(unsigned int))); //current time - QTimer *t = new QTimer(); + auto t = new QTimer(); connect(t, SIGNAL(timeout()), this, SLOT(updateInformation())); t->start(1000); @@ -206,7 +206,7 @@ void Viewer::prepareForOpening() verticalScrollBar()->setSliderPosition(verticalScrollBar()->minimum()); if (Configuration::getConfiguration().getShowInformation() && !information) { - QTimer *timer = new QTimer(); + auto timer = new QTimer(); connect(timer, SIGNAL(timeout()), this, SLOT(informationSwitch())); connect(timer, SIGNAL(timeout()), timer, SLOT(deleteLater())); timer->start(); diff --git a/YACReader/width_slider.cpp b/YACReader/width_slider.cpp index c75dabe6..02ce7163 100644 --- a/YACReader/width_slider.cpp +++ b/YACReader/width_slider.cpp @@ -34,7 +34,7 @@ YACReaderSlider::YACReaderSlider(QWidget *parent) setFocusPolicy(Qt::StrongFocus); - QHBoxLayout *pLayout = new QHBoxLayout(); + auto pLayout = new QHBoxLayout(); pLayout->addStretch(); diff --git a/YACReaderLibrary/add_label_dialog.cpp b/YACReaderLibrary/add_label_dialog.cpp index c9b09946..3b219689 100644 --- a/YACReaderLibrary/add_label_dialog.cpp +++ b/YACReaderLibrary/add_label_dialog.cpp @@ -3,7 +3,7 @@ AddLabelDialog::AddLabelDialog(QWidget *parent) : QDialog(parent) { - QVBoxLayout *layout = new QVBoxLayout; + auto layout = new QVBoxLayout; layout->addWidget(new QLabel(tr("Label name:"))); layout->addWidget(edit = new QLineEdit()); @@ -36,7 +36,7 @@ AddLabelDialog::AddLabelDialog(QWidget *parent) acceptButton = new QPushButton(tr("accept"), this); cancelButton = new QPushButton(tr("cancel"), this); - QHBoxLayout *buttons = new QHBoxLayout; + auto buttons = new QHBoxLayout; buttons->addStretch(); buttons->addWidget(acceptButton); buttons->addWidget(cancelButton); diff --git a/YACReaderLibrary/add_library_dialog.cpp b/YACReaderLibrary/add_library_dialog.cpp index 9b5f74e8..4854bb8c 100644 --- a/YACReaderLibrary/add_library_dialog.cpp +++ b/YACReaderLibrary/add_library_dialog.cpp @@ -33,7 +33,7 @@ void AddLibraryDialog::setupUI() find = new QPushButton(QIcon(":/images/find_folder.png"), ""); connect(find, SIGNAL(clicked()), this, SLOT(findPath())); - QGridLayout *content = new QGridLayout; + auto content = new QGridLayout; content->addWidget(nameLabel, 0, 0); content->addWidget(nameEdit, 0, 1); @@ -43,17 +43,17 @@ void AddLibraryDialog::setupUI() content->addWidget(find, 1, 2); content->setColumnStretch(2, 0); - QHBoxLayout *bottomLayout = new QHBoxLayout; + auto bottomLayout = new QHBoxLayout; bottomLayout->addStretch(); bottomLayout->addWidget(accept); bottomLayout->addWidget(cancel); - QVBoxLayout *mainLayout = new QVBoxLayout; + auto mainLayout = new QVBoxLayout; mainLayout->addLayout(content); mainLayout->addStretch(); mainLayout->addLayout(bottomLayout); - QHBoxLayout *imgMainLayout = new QHBoxLayout; + auto imgMainLayout = new QHBoxLayout; QLabel *imgLabel = new QLabel(this); QPixmap p(":/images/openLibrary.png"); imgLabel->setPixmap(p); diff --git a/YACReaderLibrary/classic_comics_view.cpp b/YACReaderLibrary/classic_comics_view.cpp index ff121921..56d35fc1 100644 --- a/YACReaderLibrary/classic_comics_view.cpp +++ b/YACReaderLibrary/classic_comics_view.cpp @@ -11,7 +11,7 @@ ClassicComicsView::ClassicComicsView(QWidget *parent) : ComicsView(parent), searching(false) { - QHBoxLayout *layout = new QHBoxLayout; + auto layout = new QHBoxLayout; settings = new QSettings(YACReader::getSettingsPath() + "/YACReaderLibrary.ini", QSettings::IniFormat); //TODO unificar la creación del fichero de config con el servidor settings->beginGroup("libraryConfig"); @@ -45,7 +45,7 @@ ClassicComicsView::ClassicComicsView(QWidget *parent) sVertical->addWidget(stack); comics = new QWidget; - QVBoxLayout *comicsLayout = new QVBoxLayout; + auto comicsLayout = new QVBoxLayout; comicsLayout->setSpacing(0); comicsLayout->setContentsMargins(0, 0, 0, 0); //TODO ComicsView:(set toolbar) comicsLayout->addWidget(editInfoToolBar); @@ -340,7 +340,7 @@ void ClassicComicsView::setupSearchingIcon() { searchingIcon = new QWidget(comicFlow); - QHBoxLayout *h = new QHBoxLayout; + auto h = new QHBoxLayout; QPixmap p(":/images/searching_icon.png"); QLabel *l = new QLabel(searchingIcon); diff --git a/YACReaderLibrary/comic_flow_widget.cpp b/YACReaderLibrary/comic_flow_widget.cpp index 313d1b00..5e92df23 100644 --- a/YACReaderLibrary/comic_flow_widget.cpp +++ b/YACReaderLibrary/comic_flow_widget.cpp @@ -13,7 +13,7 @@ ComicFlowWidgetSW::ComicFlowWidgetSW(QWidget *parent) connect(flow, SIGNAL(centerIndexChanged(int)), this, SIGNAL(centerIndexChanged(int))); connect(flow, SIGNAL(selected(unsigned int)), this, SIGNAL(selected(unsigned int))); - QVBoxLayout *l = new QVBoxLayout; + auto l = new QVBoxLayout; l->addWidget(flow); setLayout(l); @@ -158,7 +158,7 @@ ComicFlowWidgetGL::ComicFlowWidgetGL(QWidget *parent) connect(flow, SIGNAL(centerIndexChanged(int)), this, SIGNAL(centerIndexChanged(int))); connect(flow, SIGNAL(selected(unsigned int)), this, SIGNAL(selected(unsigned int))); - QVBoxLayout *l = new QVBoxLayout; + auto l = new QVBoxLayout; l->addWidget(flow); l->setContentsMargins(0, 0, 0, 0); setLayout(l); diff --git a/YACReaderLibrary/comic_vine/api_key_dialog.cpp b/YACReaderLibrary/comic_vine/api_key_dialog.cpp index 062c9652..c31f2490 100644 --- a/YACReaderLibrary/comic_vine/api_key_dialog.cpp +++ b/YACReaderLibrary/comic_vine/api_key_dialog.cpp @@ -12,8 +12,8 @@ ApiKeyDialog::ApiKeyDialog(QWidget *parent) : QDialog(parent) { - QVBoxLayout *layout = new QVBoxLayout; - QHBoxLayout *buttonsLayout = new QHBoxLayout; + auto layout = new QVBoxLayout; + auto buttonsLayout = new QHBoxLayout; settings = new QSettings(YACReader::getSettingsPath() + "/YACReaderLibrary.ini", QSettings::IniFormat); //TODO unificar la creación del fichero de config con el servidor settings->beginGroup("ComicVine"); diff --git a/YACReaderLibrary/comic_vine/comic_vine_client.cpp b/YACReaderLibrary/comic_vine/comic_vine_client.cpp index 7f996207..5da3621e 100644 --- a/YACReaderLibrary/comic_vine/comic_vine_client.cpp +++ b/YACReaderLibrary/comic_vine/comic_vine_client.cpp @@ -107,7 +107,7 @@ void ComicVineClient::getSeriesDetail(const QString &id) void ComicVineClient::getSeriesCover(const QString &url) { - HttpWorker *search = new HttpWorker(url); + auto search = new HttpWorker(url); connect(search, SIGNAL(dataReady(const QByteArray &)), this, SIGNAL(seriesCover(const QByteArray &))); connect(search, SIGNAL(timeout()), this, SIGNAL(timeOut())); //TODO connect(search, SIGNAL(finished()), search, SLOT(deleteLater())); @@ -127,7 +127,7 @@ void ComicVineClient::getVolumeComicsInfo(const QString &idVolume, int page) void ComicVineClient::getAllVolumeComicsInfo(const QString &idVolume) { QString url = QString(CV_COMICS_INFO).replace(CV_WEB_ADDRESS, baseURL).replace(CV_API_KEY, settings->value(COMIC_VINE_API_KEY, CV_API_KEY_DEFAULT).toString()).arg(idVolume); - ComicVineAllVolumeComicsRetriever *comicsRetriever = new ComicVineAllVolumeComicsRetriever(url); + auto comicsRetriever = new ComicVineAllVolumeComicsRetriever(url); connect(comicsRetriever, &ComicVineAllVolumeComicsRetriever::allVolumeComicsInfo, this, &ComicVineClient::volumeComicsInfo); connect(comicsRetriever, &ComicVineAllVolumeComicsRetriever::finished, this, &ComicVineClient::finished); @@ -175,7 +175,7 @@ void ComicVineClient::getComicDetailAsync(const QString &id) void ComicVineClient::getComicCover(const QString &url) { - HttpWorker *search = new HttpWorker(url); + auto search = new HttpWorker(url); connect(search, SIGNAL(dataReady(const QByteArray &)), this, SIGNAL(comicCover(QByteArray))); connect(search, SIGNAL(timeout()), this, SIGNAL(timeOut())); //TODO connect(search, SIGNAL(finished()), search, SLOT(deleteLater())); diff --git a/YACReaderLibrary/comic_vine/comic_vine_dialog.cpp b/YACReaderLibrary/comic_vine/comic_vine_dialog.cpp index 624bc7c5..911e2306 100644 --- a/YACReaderLibrary/comic_vine/comic_vine_dialog.cpp +++ b/YACReaderLibrary/comic_vine/comic_vine_dialog.cpp @@ -64,9 +64,9 @@ void ComicVineDialog::doLayout() content = new QStackedWidget(this); - QVBoxLayout *mainLayout = new QVBoxLayout; + auto mainLayout = new QVBoxLayout; - QHBoxLayout *buttonLayout = new QHBoxLayout; + auto buttonLayout = new QHBoxLayout; buttonLayout->addStretch(); buttonLayout->addWidget(skipButton); @@ -244,9 +244,9 @@ void ComicVineDialog::show() void ComicVineDialog::doLoading() { QWidget *w = new QWidget; - QVBoxLayout *l = new QVBoxLayout; + auto l = new QVBoxLayout; - YACReaderBusyWidget *bw = new YACReaderBusyWidget; + auto bw = new YACReaderBusyWidget; loadingMessage = new QLabel; loadingMessage->setStyleSheet("QLabel {color:white; font-size:12px;font-family:Arial;}"); @@ -416,7 +416,7 @@ void ComicVineDialog::getComicsInfo(QList> &matchingInfo QPair p; QList comics; foreach (p, matchingInfo) { - ComicVineClient *comicVineClient = new ComicVineClient; + auto comicVineClient = new ComicVineClient; //connect(comicVineClient,SIGNAL(searchResult(QString)),this,SLOT(debugClientResults(QString))); //connect(comicVineClient,SIGNAL(timeOut()),this,SLOT(queryTimeOut())); //connect(comicVineClient,SIGNAL(finished()),comicVineClient,SLOT(deleteLater())); @@ -448,7 +448,7 @@ void ComicVineDialog::getComicsInfo(QList> &matchingInfo void ComicVineDialog::getComicInfo(const QString &comicId, int count, const QString &publisher) { - ComicVineClient *comicVineClient = new ComicVineClient; + auto comicVineClient = new ComicVineClient; bool error; bool timeout; QByteArray result = comicVineClient->getComicDetail(comicId, error, timeout); //TODO check timeOut or Connection error @@ -673,7 +673,7 @@ void ComicVineDialog::searchVolume(const QString &v, int page) currentVolumeSearchString = v; - ComicVineClient *comicVineClient = new ComicVineClient; + auto comicVineClient = new ComicVineClient; connect(comicVineClient, SIGNAL(searchResult(QString)), this, SLOT(debugClientResults(QString))); connect(comicVineClient, SIGNAL(timeOut()), this, SLOT(queryTimeOut())); connect(comicVineClient, SIGNAL(finished()), comicVineClient, SLOT(deleteLater())); @@ -688,7 +688,7 @@ void ComicVineDialog::getVolumeComicsInfo(const QString &vID, int /* page */) status = GettingVolumeComics; - ComicVineClient *comicVineClient = new ComicVineClient; + auto comicVineClient = new ComicVineClient; if (mode == Volume) connect(comicVineClient, SIGNAL(volumeComicsInfo(QString)), this, SLOT(showSortVolumeComics(QString))); else diff --git a/YACReaderLibrary/comic_vine/scraper_results_paginator.cpp b/YACReaderLibrary/comic_vine/scraper_results_paginator.cpp index 22f658d5..0876ad71 100644 --- a/YACReaderLibrary/comic_vine/scraper_results_paginator.cpp +++ b/YACReaderLibrary/comic_vine/scraper_results_paginator.cpp @@ -9,7 +9,7 @@ ScraperResultsPaginator::ScraperResultsPaginator(QWidget *parent) : QWidget(parent), customLabel("items") { - QHBoxLayout *pagesButtonsLayout = new QHBoxLayout; + auto pagesButtonsLayout = new QHBoxLayout; QString labelStylesheet = "QLabel {color:white; font-size:12px;font-family:Arial;}"; diff --git a/YACReaderLibrary/comic_vine/search_single_comic.cpp b/YACReaderLibrary/comic_vine/search_single_comic.cpp index 70469e13..18efe1d5 100644 --- a/YACReaderLibrary/comic_vine/search_single_comic.cpp +++ b/YACReaderLibrary/comic_vine/search_single_comic.cpp @@ -20,7 +20,7 @@ SearchSingleComic::SearchSingleComic(QWidget *parent) //numberEdit->setMaximumWidth(126); - QVBoxLayout *l = new QVBoxLayout; + auto l = new QVBoxLayout; //QHBoxLayout * hl = new QHBoxLayout; //hl->addWidget(titleEdit); //hl->addWidget(numberEdit); diff --git a/YACReaderLibrary/comic_vine/select_comic.cpp b/YACReaderLibrary/comic_vine/select_comic.cpp index 1045bb01..ed090866 100644 --- a/YACReaderLibrary/comic_vine/select_comic.cpp +++ b/YACReaderLibrary/comic_vine/select_comic.cpp @@ -17,10 +17,10 @@ SelectComic::SelectComic(QWidget *parent) QLabel *label = new QLabel(tr("Please, select the right comic info.")); label->setStyleSheet(labelStylesheet); - QVBoxLayout *l = new QVBoxLayout; + auto l = new QVBoxLayout; QWidget *leftWidget = new QWidget; - QVBoxLayout *left = new QVBoxLayout; - QGridLayout *content = new QGridLayout; + auto left = new QVBoxLayout; + auto content = new QGridLayout; //widgets cover = new QLabel(); @@ -63,7 +63,7 @@ SelectComic::SelectComic(QWidget *parent) void SelectComic::load(const QString &json, const QString &searchString) { - VolumeComicsModel *tempM = new VolumeComicsModel(); + auto tempM = new VolumeComicsModel(); tempM->load(json); tableComics->setModel(tempM); @@ -93,12 +93,12 @@ void SelectComic::loadComicInfo(const QModelIndex &mi) cover->setText(loadingStyle.arg(tr("loading cover"))); detailLabel->setAltText(loadingStyle.arg(tr("loading description"))); - ComicVineClient *comicVineClient = new ComicVineClient; + auto comicVineClient = new ComicVineClient; connect(comicVineClient, SIGNAL(comicCover(const QByteArray &)), this, SLOT(setCover(const QByteArray &))); connect(comicVineClient, SIGNAL(finished()), comicVineClient, SLOT(deleteLater())); comicVineClient->getComicCover(coverURL); - ComicVineClient *comicVineClient2 = new ComicVineClient; + auto comicVineClient2 = new ComicVineClient; connect(comicVineClient2, SIGNAL(comicDetail(QString)), this, SLOT(setDescription(QString))); connect(comicVineClient2, SIGNAL(finished()), comicVineClient2, SLOT(deleteLater())); comicVineClient2->getComicDetailAsync(id); diff --git a/YACReaderLibrary/comic_vine/select_volume.cpp b/YACReaderLibrary/comic_vine/select_volume.cpp index 61fca639..eb45cde6 100644 --- a/YACReaderLibrary/comic_vine/select_volume.cpp +++ b/YACReaderLibrary/comic_vine/select_volume.cpp @@ -32,10 +32,10 @@ SelectVolume::SelectVolume(QWidget *parent) QLabel *label = new QLabel(tr("Please, select the right series for your comic.")); label->setStyleSheet(labelStylesheet); - QVBoxLayout *l = new QVBoxLayout; + auto l = new QVBoxLayout; QWidget *leftWidget = new QWidget; - QVBoxLayout *left = new QVBoxLayout; - QGridLayout *content = new QGridLayout; + auto left = new QVBoxLayout; + auto content = new QGridLayout; //widgets cover = new QLabel(); @@ -85,7 +85,7 @@ SelectVolume::SelectVolume(QWidget *parent) void SelectVolume::load(const QString &json, const QString &searchString) { - VolumesModel *tempM = new VolumesModel(); + auto tempM = new VolumesModel(); tempM->load(json); //tableVolumes->setModel(tempM); @@ -121,12 +121,12 @@ void SelectVolume::loadVolumeInfo(const QModelIndex &omi) cover->setText(loadingStyle.arg(tr("loading cover"))); detailLabel->setAltText(loadingStyle.arg(tr("loading description"))); - ComicVineClient *comicVineClient = new ComicVineClient; + auto comicVineClient = new ComicVineClient; connect(comicVineClient, SIGNAL(seriesCover(const QByteArray &)), this, SLOT(setCover(const QByteArray &))); connect(comicVineClient, SIGNAL(finished()), comicVineClient, SLOT(deleteLater())); comicVineClient->getSeriesCover(coverURL); - ComicVineClient *comicVineClient2 = new ComicVineClient; + auto comicVineClient2 = new ComicVineClient; connect(comicVineClient2, SIGNAL(seriesDetail(QString)), this, SLOT(setDescription(QString))); connect(comicVineClient2, SIGNAL(finished()), comicVineClient2, SLOT(deleteLater())); comicVineClient2->getSeriesDetail(id); diff --git a/YACReaderLibrary/comic_vine/series_question.cpp b/YACReaderLibrary/comic_vine/series_question.cpp index 9792a9d7..d04fba67 100644 --- a/YACReaderLibrary/comic_vine/series_question.cpp +++ b/YACReaderLibrary/comic_vine/series_question.cpp @@ -7,7 +7,7 @@ SeriesQuestion::SeriesQuestion(QWidget *parent) : QWidget(parent) { - QVBoxLayout *l = new QVBoxLayout; + auto l = new QVBoxLayout; QLabel *questionLabel = new QLabel(tr("You are trying to get information for various comics at once, are they part of the same series?")); questionLabel->setStyleSheet("QLabel {color:white; font-size:12px;font-family:Arial;}"); diff --git a/YACReaderLibrary/comic_vine/sort_volume_comics.cpp b/YACReaderLibrary/comic_vine/sort_volume_comics.cpp index cc8e6085..c31b9785 100644 --- a/YACReaderLibrary/comic_vine/sort_volume_comics.cpp +++ b/YACReaderLibrary/comic_vine/sort_volume_comics.cpp @@ -37,9 +37,9 @@ SortVolumeComics::SortVolumeComics(QWidget *parent) //connect(moveUpButtonIL,SIGNAL(clicked()),this,SLOT(moveUpIL())); //connect(moveUpButtonIL,SIGNAL(clicked()),this,SLOT(moveDownIL())); - QVBoxLayout *l = new QVBoxLayout; - QGridLayout *content = new QGridLayout; - QHBoxLayout *sortButtonsLayout = new QHBoxLayout; + auto l = new QVBoxLayout; + auto content = new QGridLayout; + auto sortButtonsLayout = new QHBoxLayout; tableFiles = new ScraperTableView(); tableVolumeComics = new ScraperTableView(); diff --git a/YACReaderLibrary/comic_vine/title_header.cpp b/YACReaderLibrary/comic_vine/title_header.cpp index 588b80ec..4dd4a2aa 100644 --- a/YACReaderLibrary/comic_vine/title_header.cpp +++ b/YACReaderLibrary/comic_vine/title_header.cpp @@ -13,8 +13,8 @@ TitleHeader::TitleHeader(QWidget *parent) mainTitleLabel->setStyleSheet("QLabel {color:white; font-size:18px;font-family:Arial;}"); subTitleLabel->setStyleSheet("QLabel {color:white; font-size:12px;font-family:Arial;}"); - QHBoxLayout *titleLayout = new QHBoxLayout; - QVBoxLayout *titleLabelsLayout = new QVBoxLayout; + auto titleLayout = new QHBoxLayout; + auto titleLabelsLayout = new QVBoxLayout; titleLabelsLayout->addWidget(mainTitleLabel); titleLabelsLayout->addWidget(subTitleLabel); diff --git a/YACReaderLibrary/create_library_dialog.cpp b/YACReaderLibrary/create_library_dialog.cpp index 62d694c2..0d4be557 100644 --- a/YACReaderLibrary/create_library_dialog.cpp +++ b/YACReaderLibrary/create_library_dialog.cpp @@ -35,7 +35,7 @@ void CreateLibraryDialog::setupUI() find = new QPushButton(QIcon(":/images/find_folder.png"), ""); connect(find, SIGNAL(clicked()), this, SLOT(findPath())); - QGridLayout *content = new QGridLayout; + auto content = new QGridLayout; //QHBoxLayout *nameLayout = new QHBoxLayout; @@ -49,7 +49,7 @@ void CreateLibraryDialog::setupUI() content->addWidget(find, 1, 2); content->setColumnMinimumWidth(2, 0); //TODO - QHBoxLayout *bottomLayout = new QHBoxLayout; + auto bottomLayout = new QHBoxLayout; bottomLayout->addWidget(message = new QLabel(tr("Create a library could take several minutes. You can stop the process and update the library later for completing the task."))); message->setWordWrap(true); //message->hide(); @@ -57,12 +57,12 @@ void CreateLibraryDialog::setupUI() bottomLayout->addWidget(accept); bottomLayout->addWidget(cancel); - QVBoxLayout *mainLayout = new QVBoxLayout; + auto mainLayout = new QVBoxLayout; mainLayout->addLayout(content); mainLayout->addLayout(bottomLayout); - QHBoxLayout *imgMainLayout = new QHBoxLayout; + auto imgMainLayout = new QHBoxLayout; QLabel *imgLabel = new QLabel(this); QPixmap p(":/images/new.png"); imgLabel->setPixmap(p); @@ -151,12 +151,12 @@ void CreateLibraryDialog::setDataAndStart(QString name, QString path) UpdateLibraryDialog::UpdateLibraryDialog(QWidget *parent) : QDialog(parent) { - QVBoxLayout *mainLayout = new QVBoxLayout; + auto mainLayout = new QVBoxLayout; mainLayout->addWidget(message = new QLabel(tr("Updating...."))); mainLayout->addWidget(currentFileLabel = new QLabel("\n\n\n\n")); currentFileLabel->setWordWrap(true); - QHBoxLayout *bottom = new QHBoxLayout; + auto bottom = new QHBoxLayout; bottom->addStretch(); bottom->addWidget(cancel = new QPushButton(tr("Cancel"))); @@ -167,7 +167,7 @@ UpdateLibraryDialog::UpdateLibraryDialog(QWidget *parent) mainLayout->addLayout(bottom); - QHBoxLayout *imgMainLayout = new QHBoxLayout; + auto imgMainLayout = new QHBoxLayout; QLabel *imgLabel = new QLabel(this); QPixmap p(":/images/updateLibrary.png"); imgLabel->setPixmap(p); diff --git a/YACReaderLibrary/db/comic_model.cpp b/YACReaderLibrary/db/comic_model.cpp index 4fa8414d..aa226790 100644 --- a/YACReaderLibrary/db/comic_model.cpp +++ b/YACReaderLibrary/db/comic_model.cpp @@ -202,7 +202,7 @@ QMimeData *ComicModel::mimeData(const QModelIndexList &indexes) const QDataStream out(&data, QIODevice::WriteOnly); out << ids; //serialize the list of identifiers - QMimeData *mimeData = new QMimeData(); + auto mimeData = new QMimeData(); mimeData->setData(YACReader::YACReaderLibrarComiscSelectionMimeDataFormat, data); return mimeData; @@ -272,7 +272,7 @@ QVariant ComicModel::data(const QModelIndex &index, int role) const //TODO check here if any view is asking for TableModel::Roles //these roles will be used from QML/GridView - ComicItem *item = static_cast(index.internalPointer()); + auto item = static_cast(index.internalPointer()); if (role == NumberRole) return item->data(Number); diff --git a/YACReaderLibrary/db/folder_model.cpp b/YACReaderLibrary/db/folder_model.cpp index d5427515..a789c3b3 100644 --- a/YACReaderLibrary/db/folder_model.cpp +++ b/YACReaderLibrary/db/folder_model.cpp @@ -142,7 +142,7 @@ QVariant FolderModel::data(const QModelIndex &index, int role) const if (!index.isValid()) return QVariant(); - FolderItem *item = static_cast(index.internalPointer()); + auto item = static_cast(index.internalPointer()); if (role == Qt::ToolTipRole) { QString toolTip = item->data(FolderModel::Name).toString(); @@ -238,7 +238,7 @@ QModelIndex FolderModel::parent(const QModelIndex &index) const if (!index.isValid()) return QModelIndex(); - FolderItem *childItem = static_cast(index.internalPointer()); + auto childItem = static_cast(index.internalPointer()); FolderItem *parentItem = childItem->parent(); if (parentItem == rootItem) @@ -328,7 +328,7 @@ void FolderModel::setupModelData(QSqlQuery &sqlquery, FolderItem *parent) data << sqlquery.value(path).toString(); data << sqlquery.value(finished).toBool(); data << sqlquery.value(completed).toBool(); - FolderItem *item = new FolderItem(data); + auto item = new FolderItem(data); item->id = sqlquery.value(id).toULongLong(); //la inserci�n de hijos se hace de forma ordenada @@ -360,7 +360,7 @@ void FolderModel::updateFolderModelData(QSqlQuery &sqlquery, FolderItem *parent) data << sqlquery.value(path).toString(); data << sqlquery.value(finished).toBool(); data << sqlquery.value(completed).toBool(); - FolderItem *item = new FolderItem(data); + auto item = new FolderItem(data); item->id = sqlquery.value(id).toULongLong(); //la inserci�n de hijos se hace de forma ordenada @@ -410,7 +410,7 @@ void FolderModel::updateFolderCompletedStatus(const QModelIndexList &list, bool QSqlDatabase db = DataBaseManagement::loadDatabase(_databasePath); db.transaction(); foreach (QModelIndex mi, list) { - FolderItem *item = static_cast(mi.internalPointer()); + auto item = static_cast(mi.internalPointer()); item->setData(FolderModel::Completed, status); Folder f = DBHelper::loadFolder(item->id, db); @@ -429,7 +429,7 @@ void FolderModel::updateFolderFinishedStatus(const QModelIndexList &list, bool s QSqlDatabase db = DataBaseManagement::loadDatabase(_databasePath); db.transaction(); foreach (QModelIndex mi, list) { - FolderItem *item = static_cast(mi.internalPointer()); + auto item = static_cast(mi.internalPointer()); item->setData(FolderModel::Finished, status); Folder f = DBHelper::loadFolder(item->id, db); @@ -448,7 +448,7 @@ QStringList FolderModel::getSubfoldersNames(const QModelIndex &mi) QStringList result; qulonglong id = 1; if (mi.isValid()) { - FolderItem *item = static_cast(mi.internalPointer()); + auto item = static_cast(mi.internalPointer()); id = item->id; } @@ -559,7 +559,7 @@ QModelIndex FolderModel::addFolderAtParent(const QString &folderName, const QMod data << false; //finished data << true; //completed - FolderItem *item = new FolderItem(data); + auto item = new FolderItem(data); item->id = newFolder.id; beginInsertRows(parent, 0, 0); //TODO calculate the destRow before inserting the new child @@ -577,7 +577,7 @@ void FolderModel::deleteFolder(const QModelIndex &mi) { beginRemoveRows(mi.parent(), mi.row(), mi.row()); - FolderItem *item = static_cast(mi.internalPointer()); + auto item = static_cast(mi.internalPointer()); FolderItem *parent = item->parent(); parent->removeChild(mi.row()); @@ -616,7 +616,7 @@ bool FolderModelProxy::filterAcceptsRow(int source_row, const QModelIndex &sourc if (!filterEnabled) return true; - FolderItem *parent = static_cast(source_parent.internalPointer()); + auto parent = static_cast(source_parent.internalPointer()); if (parent == 0) parent = static_cast(sourceModel())->rootItem; @@ -656,7 +656,7 @@ void FolderModelProxy::setupFilteredModelData() rootItem->id = ROOT; rootItem->parentItem = 0; - FolderModel *model = static_cast(sourceModel()); + auto model = static_cast(sourceModel()); //cargar la base de datos QSqlDatabase db = DataBaseManagement::loadDatabase(model->_databasePath); @@ -719,7 +719,7 @@ void FolderModelProxy::clear() void FolderModelProxy::setupFilteredModelData(QSqlQuery &sqlquery, FolderItem *parent) { - FolderModel *model = static_cast(sourceModel()); + auto model = static_cast(sourceModel()); //64 bits para la primary key, es decir la misma precisi�n que soporta sqlit 2^64 filteredItems.clear(); @@ -744,7 +744,7 @@ void FolderModelProxy::setupFilteredModelData(QSqlQuery &sqlquery, FolderItem *p data << sqlquery.value(finished).toBool(); data << sqlquery.value(completed).toBool(); - FolderItem *item = new FolderItem(data); + auto item = new FolderItem(data); item->id = sqlquery.value(0).toULongLong(); //id del padre diff --git a/YACReaderLibrary/db/reading_list_model.cpp b/YACReaderLibrary/db/reading_list_model.cpp index 435befea..ee38a5cc 100644 --- a/YACReaderLibrary/db/reading_list_model.cpp +++ b/YACReaderLibrary/db/reading_list_model.cpp @@ -24,10 +24,10 @@ int ReadingListModel::rowCount(const QModelIndex &parent) const int separatorsCount = 2; //labels.isEmpty()?1:2; return specialLists.count() + labels.count() + rootItem->childCount() + separatorsCount; } else { - ListItem *item = static_cast(parent.internalPointer()); + auto item = static_cast(parent.internalPointer()); if (typeid(*item) == typeid(ReadingListItem)) { - ReadingListItem *item = static_cast(parent.internalPointer()); + auto item = static_cast(parent.internalPointer()); return item->childCount(); } } @@ -38,7 +38,7 @@ int ReadingListModel::rowCount(const QModelIndex &parent) const int ReadingListModel::columnCount(const QModelIndex &parent) const { if (parent.isValid()) { - ListItem *item = static_cast(parent.internalPointer()); + auto item = static_cast(parent.internalPointer()); if (typeid(*item) == typeid(ReadingListSeparatorItem)) return 0; } @@ -54,7 +54,7 @@ QVariant ReadingListModel::data(const QModelIndex &index, int role) const if (!index.isValid()) return QVariant(); - ListItem *item = static_cast(index.internalPointer()); + auto item = static_cast(index.internalPointer()); if (role == ReadingListModel::TypeListsRole) { if (typeid(*item) == typeid(SpecialListItem)) @@ -71,7 +71,7 @@ QVariant ReadingListModel::data(const QModelIndex &index, int role) const } if (role == ReadingListModel::LabelColorRole && typeid(*item) == typeid(LabelItem)) { - LabelItem *labelItem = static_cast(item); + auto labelItem = static_cast(item); return QVariant(labelItem->colorid()); } @@ -81,7 +81,7 @@ QVariant ReadingListModel::data(const QModelIndex &index, int role) const } if (role == ReadingListModel::SpecialListTypeRole && typeid(*item) == typeid(SpecialListItem)) { - SpecialListItem *specialListItem = static_cast(item); + auto specialListItem = static_cast(item); return QVariant(specialListItem->getType()); } @@ -103,7 +103,7 @@ Qt::ItemFlags ReadingListModel::flags(const QModelIndex &index) const if (!index.isValid()) return 0; - ListItem *item = static_cast(index.internalPointer()); + auto item = static_cast(index.internalPointer()); if (typeid(*item) == typeid(ReadingListSeparatorItem)) return 0; @@ -170,10 +170,10 @@ QModelIndex ReadingListModel::parent(const QModelIndex &index) const if (!index.isValid()) return QModelIndex(); - ListItem *item = static_cast(index.internalPointer()); + auto item = static_cast(index.internalPointer()); if (typeid(*item) == typeid(ReadingListItem)) { - ReadingListItem *childItem = static_cast(index.internalPointer()); + auto childItem = static_cast(index.internalPointer()); ReadingListItem *parent = childItem->parent; if (parent->getId() != 0) return createIndex(parent->row() + specialLists.count() + labels.count() + 2, 0, parent); @@ -305,7 +305,7 @@ bool ReadingListModel::dropSublist(const QMimeData *data, Qt::DropAction action, //beginMoveRows(destParent,sourceRow,sourceRow,destParent,destRow); - ReadingListItem *parentItem = static_cast(destParent.internalPointer()); + auto parentItem = static_cast(destParent.internalPointer()); ReadingListItem *child = parentItem->child(sourceRow); parentItem->removeChild(child); parentItem->appendChild(child, destRow); @@ -339,7 +339,7 @@ QMimeData *ReadingListModel::mimeData(const QModelIndexList &indexes) const QDataStream out(&data, QIODevice::WriteOnly); out << rows; //serialize the list of identifiers - QMimeData *mimeData = new QMimeData(); + auto mimeData = new QMimeData(); mimeData->setData(YACReader::YACReaderLibrarSubReadingListMimeDataFormat, data); return mimeData; @@ -415,7 +415,7 @@ void ReadingListModel::addReadingListAt(const QString &name, const QModelIndex & beginInsertRows(mi, 0, 0); //TODO calculate the right coordinates before inserting - ReadingListItem *readingListParent = static_cast(mi.internalPointer()); + auto readingListParent = static_cast(mi.internalPointer()); qulonglong id = DBHelper::insertReadingSubList(name, mi.data(IDRole).toULongLong(), readingListParent->childCount(), db); ReadingListItem *newItem; @@ -441,7 +441,7 @@ bool ReadingListModel::isEditable(const QModelIndex &mi) { if (!mi.isValid()) return false; - ListItem *item = static_cast(mi.internalPointer()); + auto item = static_cast(mi.internalPointer()); return typeid(*item) != typeid(SpecialListItem); } @@ -449,7 +449,7 @@ bool ReadingListModel::isReadingList(const QModelIndex &mi) { if (!mi.isValid()) return false; - ListItem *item = static_cast(mi.internalPointer()); + auto item = static_cast(mi.internalPointer()); return typeid(*item) == typeid(ReadingListItem); } @@ -457,9 +457,9 @@ bool ReadingListModel::isReadingSubList(const QModelIndex &mi) { if (!mi.isValid()) return false; - ListItem *item = static_cast(mi.internalPointer()); + auto item = static_cast(mi.internalPointer()); if (typeid(*item) == typeid(ReadingListItem)) { - ReadingListItem *readingListItem = static_cast(item); + auto readingListItem = static_cast(item); if (readingListItem->parent == rootItem) return false; else @@ -480,10 +480,10 @@ void ReadingListModel::rename(const QModelIndex &mi, const QString &name) QSqlDatabase db = DataBaseManagement::loadDatabase(_databasePath); - ListItem *item = static_cast(mi.internalPointer()); + auto item = static_cast(mi.internalPointer()); if (typeid(*item) == typeid(ReadingListItem)) { - ReadingListItem *rli = static_cast(item); + auto rli = static_cast(item); rli->setName(name); DBHelper::renameList(item->getId(), name, db); @@ -493,7 +493,7 @@ void ReadingListModel::rename(const QModelIndex &mi, const QString &name) } else emit dataChanged(index(mi.row(), 0), index(mi.row(), 0)); } else if (typeid(*item) == typeid(LabelItem)) { - LabelItem *li = static_cast(item); + auto li = static_cast(item); li->setName(name); DBHelper::renameLabel(item->getId(), name, db); emit dataChanged(index(mi.row(), 0), index(mi.row(), 0)); @@ -510,10 +510,10 @@ void ReadingListModel::deleteItem(const QModelIndex &mi) QSqlDatabase db = DataBaseManagement::loadDatabase(_databasePath); - ListItem *item = static_cast(mi.internalPointer()); + auto item = static_cast(mi.internalPointer()); if (typeid(*item) == typeid(ReadingListItem)) { - ReadingListItem *rli = static_cast(item); + auto rli = static_cast(item); QLOG_DEBUG() << "num children : " << rli->parent->childCount(); rli->parent->removeChild(rli); QLOG_DEBUG() << "num children : " << rli->parent->childCount(); @@ -523,7 +523,7 @@ void ReadingListModel::deleteItem(const QModelIndex &mi) } QLOG_DEBUG() << "num children : " << rli->parent->childCount(); } else if (typeid(*item) == typeid(LabelItem)) { - LabelItem *li = static_cast(item); + auto li = static_cast(item); labels.removeOne(li); DBHelper::removeLabelFromDB(item->getId(), db); } diff --git a/YACReaderLibrary/db_helper.cpp b/YACReaderLibrary/db_helper.cpp index 90f2fa71..9d53105b 100644 --- a/YACReaderLibrary/db_helper.cpp +++ b/YACReaderLibrary/db_helper.cpp @@ -1071,7 +1071,7 @@ QList DBHelper::getFoldersFromParent(qulonglong parentId, QSqlDat if (list.isEmpty() || !sort) list.append(currentItem); else { - Folder *last = static_cast(list.back()); + auto last = static_cast(list.back()); QString nameLast = last->name; QString nameCurrent = currentItem->name; QList::iterator i; diff --git a/YACReaderLibrary/empty_container_info.cpp b/YACReaderLibrary/empty_container_info.cpp index 0fcd7474..9dbb5231 100644 --- a/YACReaderLibrary/empty_container_info.cpp +++ b/YACReaderLibrary/empty_container_info.cpp @@ -27,7 +27,7 @@ void EmptyContainerInfo::setText(const QString &text) QVBoxLayout *EmptyContainerInfo::setUpDefaultLayout(bool addStretch) { - QVBoxLayout *layout = new QVBoxLayout; + auto layout = new QVBoxLayout; layout->addSpacing(100); layout->addWidget(iconLabel); diff --git a/YACReaderLibrary/export_comics_info_dialog.cpp b/YACReaderLibrary/export_comics_info_dialog.cpp index 33ac3422..171bd0c1 100644 --- a/YACReaderLibrary/export_comics_info_dialog.cpp +++ b/YACReaderLibrary/export_comics_info_dialog.cpp @@ -26,25 +26,25 @@ ExportComicsInfoDialog::ExportComicsInfoDialog(QWidget *parent) find = new QPushButton(QIcon(":/images/find_folder.png"), ""); connect(find, SIGNAL(clicked()), this, SLOT(findPath())); - QHBoxLayout *libraryLayout = new QHBoxLayout; + auto libraryLayout = new QHBoxLayout; libraryLayout->addWidget(textLabel); libraryLayout->addWidget(path); libraryLayout->addWidget(find); libraryLayout->setStretchFactor(find, 0); //TODO - QHBoxLayout *bottomLayout = new QHBoxLayout; + auto bottomLayout = new QHBoxLayout; bottomLayout->addStretch(); bottomLayout->addWidget(accept); bottomLayout->addWidget(cancel); - QVBoxLayout *mainLayout = new QVBoxLayout; + auto mainLayout = new QVBoxLayout; mainLayout->addLayout(libraryLayout); mainLayout->addWidget(progress = new QLabel()); mainLayout->addStretch(); mainLayout->addLayout(bottomLayout); - QHBoxLayout *imgMainLayout = new QHBoxLayout; + auto imgMainLayout = new QHBoxLayout; QLabel *imgLabel = new QLabel(this); QPixmap p(":/images/exportComicsInfo.png"); imgLabel->setPixmap(p); diff --git a/YACReaderLibrary/export_library_dialog.cpp b/YACReaderLibrary/export_library_dialog.cpp index 795a6df6..bf2b0b85 100644 --- a/YACReaderLibrary/export_library_dialog.cpp +++ b/YACReaderLibrary/export_library_dialog.cpp @@ -23,14 +23,14 @@ ExportLibraryDialog::ExportLibraryDialog(QWidget *parent) find = new QPushButton(QIcon(":/images/find_folder.png"), ""); connect(find, SIGNAL(clicked()), this, SLOT(findPath())); - QHBoxLayout *libraryLayout = new QHBoxLayout; + auto libraryLayout = new QHBoxLayout; libraryLayout->addWidget(textLabel); libraryLayout->addWidget(path); libraryLayout->addWidget(find); libraryLayout->setStretchFactor(find, 0); //TODO - QHBoxLayout *bottomLayout = new QHBoxLayout; + auto bottomLayout = new QHBoxLayout; bottomLayout->addStretch(); bottomLayout->addWidget(accept); bottomLayout->addWidget(cancel); @@ -41,13 +41,13 @@ ExportLibraryDialog::ExportLibraryDialog(QWidget *parent) progressBar->setTextVisible(false); progressBar->hide(); - QVBoxLayout *mainLayout = new QVBoxLayout; + auto mainLayout = new QVBoxLayout; mainLayout->addLayout(libraryLayout); mainLayout->addStretch(); mainLayout->addWidget(progressBar); mainLayout->addLayout(bottomLayout); - QHBoxLayout *imgMainLayout = new QHBoxLayout; + auto imgMainLayout = new QHBoxLayout; QLabel *imgLabel = new QLabel(this); QPixmap p(":/images/exportLibrary.png"); imgLabel->setPixmap(p); diff --git a/YACReaderLibrary/grid_comics_view.cpp b/YACReaderLibrary/grid_comics_view.cpp index 2757655e..4db367a3 100644 --- a/YACReaderLibrary/grid_comics_view.cpp +++ b/YACReaderLibrary/grid_comics_view.cpp @@ -143,7 +143,7 @@ GridComicsView::GridComicsView(QWidget *parent) ctxt->setContextProperty("backgroundBlurRadius", 0.0); ctxt->setContextProperty("backgroundBlurVisible", false); - ComicModel *model = new ComicModel(); + auto model = new ComicModel(); selectionHelper->setModel(model); ctxt->setContextProperty("comicsList", model); ctxt->setContextProperty("comicsSelection", selectionHelper->selectionModel()); @@ -161,8 +161,8 @@ GridComicsView::GridComicsView(QWidget *parent) view->setSource(QUrl("qrc:/qml/GridComicsView.qml")); - QObject *rootObject = dynamic_cast(view->rootObject()); - QObject *infoContainer = rootObject->findChild("infoContainer"); + auto rootObject = dynamic_cast(view->rootObject()); + auto infoContainer = rootObject->findChild("infoContainer"); QQmlProperty(infoContainer, "width").write(settings->value(COMICS_GRID_INFO_WIDTH, 350)); @@ -174,7 +174,7 @@ GridComicsView::GridComicsView(QWidget *parent) setShowMarks(true); //TODO save this in settings - QVBoxLayout *l = new QVBoxLayout; + auto l = new QVBoxLayout; l->addWidget(view); this->setLayout(l); @@ -199,7 +199,7 @@ void GridComicsView::createCoverSizeSliderWidget() coverSizeSlider->setOrientation(Qt::Horizontal); coverSizeSlider->setRange(YACREADER_MIN_GRID_ZOOM_WIDTH, YACREADER_MAX_GRID_ZOOM_WIDTH); - QHBoxLayout *horizontalLayout = new QHBoxLayout(); + auto horizontalLayout = new QHBoxLayout(); QLabel *smallLabel = new QLabel(); smallLabel->setPixmap(QPixmap(":/images/comics_view_toolbar/small_size_grid_zoom.png")); horizontalLayout->addWidget(smallLabel); @@ -409,7 +409,7 @@ void GridComicsView::setCoversSize(int width) { QQmlContext *ctxt = view->rootContext(); - QQuickItem *grid = view->rootObject()->findChild(QStringLiteral("grid")); + auto grid = view->rootObject()->findChild(QStringLiteral("grid")); if (grid != 0) { QVariant cellCustomWidth = (width * YACREADER_MIN_CELL_CUSTOM_WIDTH) / YACREADER_MIN_GRID_ZOOM_WIDTH; @@ -462,8 +462,8 @@ void GridComicsView::setCurrentComicIfNeeded() void GridComicsView::resetScroll() { - QObject *rootObject = dynamic_cast(view->rootObject()); - QObject *scrollView = rootObject->findChild("topScrollView", Qt::FindChildrenRecursively); + auto rootObject = dynamic_cast(view->rootObject()); + auto scrollView = rootObject->findChild("topScrollView", Qt::FindChildrenRecursively); QMetaObject::invokeMethod(scrollView, "scrollToOrigin"); } @@ -492,7 +492,7 @@ void GridComicsView::updateCurrentComicView() void GridComicsView::startDrag() { - QDrag *drag = new QDrag(this); + auto drag = new QDrag(this); drag->setMimeData(model->mimeData(selectionHelper->selectedRows())); drag->setPixmap(QPixmap(":/images/comics_view_toolbar/openInYACReader.png")); //TODO add better image @@ -553,8 +553,8 @@ void GridComicsView::closeEvent(QCloseEvent *event) toolbar->removeAction(showInfoSeparatorAction); toolbar->removeAction(coverSizeSliderAction); - QObject *rootObject = dynamic_cast(view->rootObject()); - QObject *infoContainer = rootObject->findChild("infoContainer", Qt::FindChildrenRecursively); + auto rootObject = dynamic_cast(view->rootObject()); + auto infoContainer = rootObject->findChild("infoContainer", Qt::FindChildrenRecursively); int infoWidth = QQmlProperty(infoContainer, "width").read().toInt(); diff --git a/YACReaderLibrary/import_comics_info_dialog.cpp b/YACReaderLibrary/import_comics_info_dialog.cpp index 056aad1d..671b6baf 100644 --- a/YACReaderLibrary/import_comics_info_dialog.cpp +++ b/YACReaderLibrary/import_comics_info_dialog.cpp @@ -28,7 +28,7 @@ ImportComicsInfoDialog::ImportComicsInfoDialog(QWidget *parent) find = new QPushButton(QIcon(":/images/find_folder.png"), ""); connect(find, SIGNAL(clicked()), this, SLOT(findPath())); - QHBoxLayout *libraryLayout = new QHBoxLayout; + auto libraryLayout = new QHBoxLayout; libraryLayout->addWidget(textLabel); libraryLayout->addWidget(path); @@ -42,18 +42,18 @@ ImportComicsInfoDialog::ImportComicsInfoDialog(QWidget *parent) progressBar->hide(); connect(accept, SIGNAL(clicked()), progressBar, SLOT(show())); - QHBoxLayout *bottomLayout = new QHBoxLayout; + auto bottomLayout = new QHBoxLayout; bottomLayout->addStretch(); bottomLayout->addWidget(accept); bottomLayout->addWidget(cancel); - QVBoxLayout *mainLayout = new QVBoxLayout; + auto mainLayout = new QVBoxLayout; mainLayout->addLayout(libraryLayout); mainLayout->addStretch(); mainLayout->addWidget(progressBar); mainLayout->addLayout(bottomLayout); - QHBoxLayout *imgMainLayout = new QHBoxLayout; + auto imgMainLayout = new QHBoxLayout; QLabel *imgLabel = new QLabel(this); QPixmap p(":/images/importComicsInfo.png"); imgLabel->setPixmap(p); @@ -82,7 +82,7 @@ void ImportComicsInfoDialog::import() { progressBar->show(); - Importer *importer = new Importer(); + auto importer = new Importer(); importer->source = path->text(); importer->dest = dest; connect(importer, SIGNAL(finished()), this, SLOT(close())); diff --git a/YACReaderLibrary/import_library_dialog.cpp b/YACReaderLibrary/import_library_dialog.cpp index 6c96fb5f..420d9e22 100644 --- a/YACReaderLibrary/import_library_dialog.cpp +++ b/YACReaderLibrary/import_library_dialog.cpp @@ -41,7 +41,7 @@ void ImportLibraryDialog::setupUI() findDest = new QPushButton(QIcon(":/images/find_folder.png"), ""); connect(findDest, SIGNAL(clicked()), this, SLOT(findDestination())); - QGridLayout *content = new QGridLayout; + auto content = new QGridLayout; content->addWidget(nameLabel, 0, 0); content->addWidget(nameEdit, 0, 1); @@ -56,7 +56,7 @@ void ImportLibraryDialog::setupUI() content->addWidget(findDest, 2, 2); //destLayout->setStretchFactor(findDest,0); //TODO - QHBoxLayout *bottomLayout = new QHBoxLayout; + auto bottomLayout = new QHBoxLayout; bottomLayout->addStretch(); bottomLayout->addWidget(accept); bottomLayout->addWidget(cancel); @@ -67,14 +67,14 @@ void ImportLibraryDialog::setupUI() progressBar->setTextVisible(false); progressBar->hide(); - QVBoxLayout *mainLayout = new QVBoxLayout; + auto mainLayout = new QVBoxLayout; mainLayout->addLayout(content); //mainLayout->addWidget(progress = new QLabel()); mainLayout->addStretch(); mainLayout->addWidget(progressBar); mainLayout->addLayout(bottomLayout); - QHBoxLayout *imgMainLayout = new QHBoxLayout; + auto imgMainLayout = new QHBoxLayout; QLabel *imgLabel = new QLabel(this); QPixmap p(":/images/importLibrary.png"); imgLabel->setPixmap(p); diff --git a/YACReaderLibrary/import_widget.cpp b/YACReaderLibrary/import_widget.cpp index 0795e205..ea2ec62b 100644 --- a/YACReaderLibrary/import_widget.cpp +++ b/YACReaderLibrary/import_widget.cpp @@ -42,7 +42,7 @@ YACReaderActivityIndicatorWidget::YACReaderActivityIndicatorWidget(QWidget *pare normal->setPixmap(line); glow->setPixmap(glowLine); - QHBoxLayout *layout = new QHBoxLayout(); + auto layout = new QHBoxLayout(); layout->addWidget(normal, 0, Qt::AlignVCenter); @@ -56,7 +56,7 @@ YACReaderActivityIndicatorWidget::YACReaderActivityIndicatorWidget(QWidget *pare glow->setGeometry(4, 4, glowLine.width(), glowLine.height()); //normal->setGeometry(0,1,579,1); - QGraphicsOpacityEffect *effect = new QGraphicsOpacityEffect(); + auto effect = new QGraphicsOpacityEffect(); //effect->setOpacity(1.0); QPropertyAnimation *animation = new QPropertyAnimation(effect, "opacity"); @@ -99,7 +99,7 @@ ImportWidget::ImportWidget(QWidget *parent) QLabel * lineLabel = new QLabel(); lineLabel->setPixmap(line);*/ - YACReaderActivityIndicatorWidget *activityIndicator = new YACReaderActivityIndicatorWidget(); + auto activityIndicator = new YACReaderActivityIndicatorWidget(); text = new QLabel(); //""+tr("Importing comics")+""); text->setStyleSheet("QLabel {font-size:25px;font-weight:bold;}"); @@ -109,7 +109,7 @@ ImportWidget::ImportWidget(QWidget *parent) currentComicLabel = new QLabel("..."); coversViewContainer = new QWidget(this); - QVBoxLayout *coversViewLayout = new QVBoxLayout; + auto coversViewLayout = new QVBoxLayout; coversViewContainer->setLayout(coversViewLayout); coversViewContainer->setMaximumHeight(316); coversViewContainer->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Maximum); @@ -151,10 +151,10 @@ ImportWidget::ImportWidget(QWidget *parent) stop->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Maximum); stopButton = stop; - QVBoxLayout *layout = new QVBoxLayout(this); - QHBoxLayout *buttonLayout = new QHBoxLayout(); - QHBoxLayout *topLayout = new QHBoxLayout(); - QVBoxLayout *textLayout = new QVBoxLayout(); + auto layout = new QVBoxLayout(this); + auto buttonLayout = new QHBoxLayout(); + auto topLayout = new QHBoxLayout(); + auto textLayout = new QVBoxLayout(); QWidget *topWidget = new QWidget(); topWidget->setFixedWidth(650); @@ -227,14 +227,14 @@ void ImportWidget::newComic(const QString &path, const QString &coverPath) QPixmap p(coverPath); p = p.scaledToHeight(300, Qt::SmoothTransformation); - QGraphicsPixmapItem *item = new QGraphicsPixmapItem(p); + auto item = new QGraphicsPixmapItem(p); item->setPos(previousWidth, 0); coversScene->addItem(item); previousWidth += 10 + p.width(); foreach (QGraphicsItem *itemToRemove, coversScene->items()) { - QGraphicsPixmapItem *last = dynamic_cast(itemToRemove); + auto last = dynamic_cast(itemToRemove); if ((last->pos().x() + last->pixmap().width()) < coversView->horizontalScrollBar()->value()) //TODO check this { @@ -267,7 +267,7 @@ void ImportWidget::addCoverTest() { QPixmap p(QString("c:/temp/%1.jpg").arg(i)); p = p.scaledToHeight(300, Qt::SmoothTransformation); - QGraphicsPixmapItem *item = new QGraphicsPixmapItem(p); + auto item = new QGraphicsPixmapItem(p); item->setPos(previousWidth, 0); item->setZValue(i / 10000.0); previousWidth += 10 + p.width(); @@ -283,10 +283,10 @@ void ImportWidget::addCoverTest() foreach (QGraphicsItem *itemToMove, coversScene->items()) { - QTimeLine *timer = new QTimeLine(/*350*/ 1000); + auto timer = new QTimeLine(/*350*/ 1000); timer->setFrameRange(0, 60); - QGraphicsItemAnimation *animation = new QGraphicsItemAnimation; + auto animation = new QGraphicsItemAnimation; animation->setItem(itemToMove); animation->setTimeLine(timer); diff --git a/YACReaderLibrary/info_comics_view.cpp b/YACReaderLibrary/info_comics_view.cpp index 5ebc975f..f4d0c87e 100644 --- a/YACReaderLibrary/info_comics_view.cpp +++ b/YACReaderLibrary/info_comics_view.cpp @@ -78,7 +78,7 @@ InfoComicsView::InfoComicsView(QWidget *parent) view->setSource(QUrl("qrc:/qml/InfoComicsView.qml")); - QObject *rootObject = dynamic_cast(view->rootObject()); + auto rootObject = dynamic_cast(view->rootObject()); flow = rootObject->findChild("flow"); list = rootObject->findChild("list"); @@ -88,7 +88,7 @@ InfoComicsView::InfoComicsView(QWidget *parent) selectionHelper = new YACReaderComicsSelectionHelper(this); comicInfoHelper = new YACReaderComicInfoHelper(this); - QVBoxLayout *l = new QVBoxLayout; + auto l = new QVBoxLayout; l->addWidget(view); this->setLayout(l); diff --git a/YACReaderLibrary/library_creator.cpp b/YACReaderLibrary/library_creator.cpp index 4e4dd393..eb8bc3ab 100644 --- a/YACReaderLibrary/library_creator.cpp +++ b/YACReaderLibrary/library_creator.cpp @@ -550,7 +550,7 @@ void ThumbnailCreator::create() return; } #elif defined USE_PDFIUM - PdfiumComic *pdfComic = new PdfiumComic(); + auto pdfComic = new PdfiumComic(); if (!pdfComic->openComic(_fileSource)) { delete pdfComic; return; diff --git a/YACReaderLibrary/library_window.cpp b/YACReaderLibrary/library_window.cpp index f196d665..eae3f19e 100644 --- a/YACReaderLibrary/library_window.cpp +++ b/YACReaderLibrary/library_window.cpp @@ -172,7 +172,7 @@ void LibraryWindow::changeEvent(QEvent *event) void LibraryWindow::doLayout() { //LAYOUT ELEMENTS------------------------------------------------------------ - QSplitter *sHorizontal = new QSplitter(Qt::Horizontal); //spliter principal + auto sHorizontal = new QSplitter(Qt::Horizontal); //spliter principal #ifdef Q_OS_MAC sHorizontal->setStyleSheet("QSplitter::handle{image:none;background-color:#B8B8B8;} QSplitter::handle:vertical {height:1px;}"); #else @@ -1278,7 +1278,7 @@ void LibraryWindow::copyAndImportComicsToCurrentFolder(const QListcopyComicsTo(comics, destFolderPath, folderDestination); processComicFiles(comicFilesManager, progressDialog); @@ -1295,7 +1295,7 @@ void LibraryWindow::moveAndImportComicsToCurrentFolder(const QListmoveComicsTo(comics, destFolderPath, folderDestination); processComicFiles(comicFilesManager, progressDialog); @@ -1314,7 +1314,7 @@ void LibraryWindow::copyAndImportComicsToFolder(const QListcopyComicsTo(comics, destFolderPath, folderDestination); processComicFiles(comicFilesManager, progressDialog); @@ -1333,7 +1333,7 @@ void LibraryWindow::moveAndImportComicsToFolder(const QListmoveComicsTo(comics, destFolderPath, folderDestination); processComicFiles(comicFilesManager, progressDialog); @@ -1478,7 +1478,7 @@ void LibraryWindow::deleteSelectedFolder() QList paths; paths << folderPath; - FoldersRemover *remover = new FoldersRemover(indexList, paths); + auto remover = new FoldersRemover(indexList, paths); QThread *thread = NULL; @@ -1544,7 +1544,7 @@ void LibraryWindow::deleteSelectedReadingList() void LibraryWindow::showAddNewLabelDialog() { - AddLabelDialog *dialog = new AddLabelDialog(); + auto dialog = new AddLabelDialog(); int ret = dialog->exec(); if (ret == QDialog::Accepted) { @@ -1651,7 +1651,7 @@ void LibraryWindow::setupAddToSubmenu(QMenu &menu) if (labels.count() > 0) menu.addSeparator(); foreach (LabelItem *label, labels) { - QAction *action = new QAction(this); + auto action = new QAction(this); action->setIcon(label->getIcon()); action->setText(label->name()); @@ -1665,7 +1665,7 @@ void LibraryWindow::setupAddToSubmenu(QMenu &menu) void LibraryWindow::onAddComicsToLabel() { - QAction *action = static_cast(sender()); + auto action = static_cast(sender()); qulonglong labelId = action->data().toULongLong(); @@ -2061,7 +2061,7 @@ void LibraryWindow::toNormal() showNormal(); #ifdef Q_OS_MAC - QTimer *timer = new QTimer(); + auto timer = new QTimer(); timer->setSingleShot(true); timer->start(); connect(timer, SIGNAL(timeout()), libraryToolBar, SLOT(show())); @@ -2421,7 +2421,7 @@ void LibraryWindow::deleteComicsFromDisk() QLOG_TRACE() << comic.parentId; } - ComicsRemover *remover = new ComicsRemover(indexList, paths, comics.at(0).parentId); + auto remover = new ComicsRemover(indexList, paths, comics.at(0).parentId); QThread *thread = NULL; thread = new QThread(this); diff --git a/YACReaderLibrary/main.cpp b/YACReaderLibrary/main.cpp index 0dbc9b91..8501179d 100644 --- a/YACReaderLibrary/main.cpp +++ b/YACReaderLibrary/main.cpp @@ -231,9 +231,9 @@ int main(int argc, char **argv) } QLOG_INFO() << "YACReaderLibrary starting"; - YACReaderLocalServer *localServer = new YACReaderLocalServer(); + auto localServer = new YACReaderLocalServer(); - LibraryWindow *mw = new LibraryWindow(); + auto mw = new LibraryWindow(); mw->connect(localServer, SIGNAL(comicUpdated(quint64, const ComicDB &)), mw, SLOT(updateComicsView(quint64, const ComicDB &)), Qt::QueuedConnection); diff --git a/YACReaderLibrary/no_libraries_widget.cpp b/YACReaderLibrary/no_libraries_widget.cpp index f7aef33c..3ecbc925 100644 --- a/YACReaderLibrary/no_libraries_widget.cpp +++ b/YACReaderLibrary/no_libraries_widget.cpp @@ -34,10 +34,10 @@ NoLibrariesWidget::NoLibrariesWidget(QWidget *parent) QPushButton *addButton = new QPushButton(tr("add an existing one")); addButton->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred); - QVBoxLayout *layout = new QVBoxLayout(this); - QHBoxLayout *buttonLayout = new QHBoxLayout(); - QHBoxLayout *topLayout = new QHBoxLayout(); - QVBoxLayout *textLayout = new QVBoxLayout(); + auto layout = new QVBoxLayout(this); + auto buttonLayout = new QHBoxLayout(); + auto topLayout = new QHBoxLayout(); + auto textLayout = new QVBoxLayout(); QWidget *topWidget = new QWidget(); topWidget->setFixedWidth(650); diff --git a/YACReaderLibrary/no_search_results_widget.cpp b/YACReaderLibrary/no_search_results_widget.cpp index 96a9d423..ef7dc611 100644 --- a/YACReaderLibrary/no_search_results_widget.cpp +++ b/YACReaderLibrary/no_search_results_widget.cpp @@ -13,7 +13,7 @@ NoSearchResultsWidget::NoSearchResultsWidget(QWidget *parent) backgroundColor = "#2A2A2A"; #endif - QVBoxLayout *layout = new QVBoxLayout; + auto layout = new QVBoxLayout; iconLabel = new QLabel(); iconLabel->setPixmap(QPixmap(":/images/empty_search.png")); diff --git a/YACReaderLibrary/options_dialog.cpp b/YACReaderLibrary/options_dialog.cpp index 505b0cd8..2a05ac72 100644 --- a/YACReaderLibrary/options_dialog.cpp +++ b/YACReaderLibrary/options_dialog.cpp @@ -14,20 +14,20 @@ FlowType flowType = Strip; OptionsDialog::OptionsDialog(QWidget *parent) : YACReaderOptionsDialog(parent) { - QTabWidget *tabWidget = new QTabWidget(); + auto tabWidget = new QTabWidget(); - QVBoxLayout *layout = new QVBoxLayout(this); + auto layout = new QVBoxLayout(this); - QVBoxLayout *flowLayout = new QVBoxLayout; - QVBoxLayout *gridViewLayout = new QVBoxLayout(); - QVBoxLayout *generalLayout = new QVBoxLayout(); + auto flowLayout = new QVBoxLayout; + auto gridViewLayout = new QVBoxLayout(); + auto generalLayout = new QVBoxLayout(); - QHBoxLayout *switchFlowType = new QHBoxLayout(); + auto switchFlowType = new QHBoxLayout(); switchFlowType->addStretch(); #ifndef NO_OPENGL switchFlowType->addWidget(useGL); #endif - QHBoxLayout *buttons = new QHBoxLayout(); + auto buttons = new QHBoxLayout(); buttons->addStretch(); buttons->addWidget(accept); buttons->addWidget(cancel); @@ -42,11 +42,11 @@ OptionsDialog::OptionsDialog(QWidget *parent) sw->hide(); #endif - QVBoxLayout *apiKeyLayout = new QVBoxLayout(); - QPushButton *apiKeyButton = new QPushButton(tr("Edit Comic Vine API key")); + auto apiKeyLayout = new QVBoxLayout(); + auto apiKeyButton = new QPushButton(tr("Edit Comic Vine API key")); apiKeyLayout->addWidget(apiKeyButton); - QGroupBox *apiKeyBox = new QGroupBox(tr("Comic Vine API key")); + auto apiKeyBox = new QGroupBox(tr("Comic Vine API key")); apiKeyBox->setLayout(apiKeyLayout); connect(apiKeyButton, SIGNAL(clicked()), this, SLOT(editApiKey())); @@ -68,7 +68,7 @@ OptionsDialog::OptionsDialog(QWidget *parent) resetButton = new QPushButton(tr("Restore defautls")); - QVBoxLayout *gridBackgroundLayout = new QVBoxLayout(); + auto gridBackgroundLayout = new QVBoxLayout(); gridBackgroundLayout->addWidget(useBackgroundImageCheck); gridBackgroundLayout->addWidget(opacityLabel); gridBackgroundLayout->addWidget(backgroundImageOpacitySlider); @@ -77,7 +77,7 @@ OptionsDialog::OptionsDialog(QWidget *parent) gridBackgroundLayout->addWidget(useCurrentComicCoverCheck); gridBackgroundLayout->addWidget(resetButton, 0, Qt::AlignRight); - QGroupBox *gridBackgroundGroup = new QGroupBox(tr("Background")); + auto gridBackgroundGroup = new QGroupBox(tr("Background")); gridBackgroundGroup->setLayout(gridBackgroundLayout); gridViewLayout->addWidget(gridBackgroundGroup); @@ -90,13 +90,13 @@ OptionsDialog::OptionsDialog(QWidget *parent) connect(resetButton, &QPushButton::clicked, this, &OptionsDialog::resetToDefaults); //end grid view background config - QWidget *comicFlowW = new QWidget; + auto comicFlowW = new QWidget; comicFlowW->setLayout(flowLayout); - QWidget *gridViewW = new QWidget; + auto gridViewW = new QWidget; gridViewW->setLayout(gridViewLayout); - QWidget *generalW = new QWidget; + auto generalW = new QWidget; generalW->setLayout(generalLayout); generalLayout->addWidget(shortcutsBox); generalLayout->addWidget(apiKeyBox); diff --git a/YACReaderLibrary/properties_dialog.cpp b/YACReaderLibrary/properties_dialog.cpp index fc24e758..c5e81d62 100644 --- a/YACReaderLibrary/properties_dialog.cpp +++ b/YACReaderLibrary/properties_dialog.cpp @@ -81,7 +81,7 @@ void PropertiesDialog::createCoverBox() { coverBox = new QWidget(this); - QHBoxLayout *layout = new QHBoxLayout; + auto layout = new QHBoxLayout; QLabel *label = new QLabel(tr("Cover page")); label->setStyleSheet("QLabel {color: white; font-weight:bold; font-size:14px;}"); @@ -139,13 +139,13 @@ void PropertiesDialog::createGeneralInfoBox() { generalInfoBox = new QWidget; - QFormLayout *generalInfoLayout = new QFormLayout; + auto generalInfoLayout = new QFormLayout; generalInfoLayout->setFieldGrowthPolicy(QFormLayout::ExpandingFieldsGrow); //generalInfoLayout->setRowWrapPolicy(QFormLayout::WrapAllRows); generalInfoLayout->addRow(tr("Title:"), title = new YACReaderFieldEdit()); - QHBoxLayout *number = new QHBoxLayout; + auto number = new QHBoxLayout; number->addWidget(numberEdit = new YACReaderFieldEdit()); numberValidator.setBottom(0); numberEdit->setValidator(&numberValidator); @@ -162,7 +162,7 @@ void PropertiesDialog::createGeneralInfoBox() generalInfoLayout->addRow(tr("Volume:"), volumeEdit = new YACReaderFieldEdit()); - QHBoxLayout *arc = new QHBoxLayout; + auto arc = new QHBoxLayout; arc->addWidget(storyArcEdit = new YACReaderFieldEdit()); arc->addWidget(new QLabel(tr("Arc number:"))); arc->addWidget(arcNumberEdit = new YACReaderFieldEdit()); @@ -182,7 +182,7 @@ void PropertiesDialog::createGeneralInfoBox() //generalInfoLayout->addRow(tr("Comic Vine link:"), comicVineLink = new QLabel("...")); //generalInfoLayout->addRow(bottom); - QVBoxLayout *main = new QVBoxLayout; + auto main = new QVBoxLayout; main->addLayout(generalInfoLayout); main->addStretch(); main->addWidget(comicVineLink = new QLabel("Comic Vine link : ...")); @@ -195,12 +195,12 @@ void PropertiesDialog::createAuthorsBox() { authorsBox = new QWidget; - QVBoxLayout *authorsLayout = new QVBoxLayout; + auto authorsLayout = new QVBoxLayout; //authorsLayout->setRowWrapPolicy(QFormLayout::WrapAllRows); - QHBoxLayout *h1 = new QHBoxLayout; - QVBoxLayout *vl1 = new QVBoxLayout; - QVBoxLayout *vr1 = new QVBoxLayout; + auto h1 = new QHBoxLayout; + auto vl1 = new QVBoxLayout; + auto vr1 = new QVBoxLayout; vl1->addWidget(new QLabel(tr("Writer(s):"))); vl1->addWidget(writer = new YACReaderFieldPlainTextEdit()); h1->addLayout(vl1); @@ -209,9 +209,9 @@ void PropertiesDialog::createAuthorsBox() h1->addLayout(vr1); //authorsLayout->addRow(tr("Writer(s):"), new YACReaderFieldPlainTextEdit()); //authorsLayout->addRow(tr("Penciller(s):"), new YACReaderFieldPlainTextEdit()); - QHBoxLayout *h2 = new QHBoxLayout; - QVBoxLayout *vl2 = new QVBoxLayout; - QVBoxLayout *vr2 = new QVBoxLayout; + auto h2 = new QHBoxLayout; + auto vl2 = new QVBoxLayout; + auto vr2 = new QVBoxLayout; vl2->addWidget(new QLabel(tr("Inker(s):"))); vl2->addWidget(inker = new YACReaderFieldPlainTextEdit()); h2->addLayout(vl2); @@ -222,9 +222,9 @@ void PropertiesDialog::createAuthorsBox() //authorsLayout->addRow(tr("Inker(s):"), new YACReaderFieldPlainTextEdit()); //authorsLayout->addRow(tr("Colorist(s):"), new YACReaderFieldPlainTextEdit()); - QHBoxLayout *h3 = new QHBoxLayout; - QVBoxLayout *vl3 = new QVBoxLayout; - QVBoxLayout *vr3 = new QVBoxLayout; + auto h3 = new QHBoxLayout; + auto vl3 = new QVBoxLayout; + auto vr3 = new QVBoxLayout; vl3->addWidget(new QLabel(tr("Letterer(s):"))); vl3->addWidget(letterer = new YACReaderFieldPlainTextEdit()); h3->addLayout(vl3); @@ -245,11 +245,11 @@ void PropertiesDialog::createPublishingBox() { publishingBox = new QWidget; - QFormLayout *publishingLayout = new QFormLayout; + auto publishingLayout = new QFormLayout; publishingLayout->setFieldGrowthPolicy(QFormLayout::ExpandingFieldsGrow); - QHBoxLayout *date = new QHBoxLayout; + auto date = new QHBoxLayout; date->addWidget(new QLabel(tr("Day:"))); date->addWidget(dayEdit = new YACReaderFieldEdit()); dayValidator.setRange(1, 31); @@ -278,7 +278,7 @@ void PropertiesDialog::createPlotBox() { plotBox = new QWidget; - QFormLayout *plotLayout = new QFormLayout; + auto plotLayout = new QFormLayout; plotLayout->setFieldGrowthPolicy(QFormLayout::ExpandingFieldsGrow); plotLayout->setRowWrapPolicy(QFormLayout::WrapAllRows); diff --git a/YACReaderLibrary/rename_library_dialog.cpp b/YACReaderLibrary/rename_library_dialog.cpp index 852aaa8e..ad0b61a2 100644 --- a/YACReaderLibrary/rename_library_dialog.cpp +++ b/YACReaderLibrary/rename_library_dialog.cpp @@ -24,22 +24,22 @@ void RenameLibraryDialog::setupUI() cancel = new QPushButton(tr("Cancel")); connect(cancel, SIGNAL(clicked()), this, SLOT(close())); - QHBoxLayout *nameLayout = new QHBoxLayout; + auto nameLayout = new QHBoxLayout; nameLayout->addWidget(newNameLabel); nameLayout->addWidget(newNameEdit); - QHBoxLayout *bottomLayout = new QHBoxLayout; + auto bottomLayout = new QHBoxLayout; bottomLayout->addStretch(); bottomLayout->addWidget(accept); bottomLayout->addWidget(cancel); - QVBoxLayout *mainLayout = new QVBoxLayout; + auto mainLayout = new QVBoxLayout; mainLayout->addLayout(nameLayout); mainLayout->addStretch(); mainLayout->addLayout(bottomLayout); - QHBoxLayout *imgMainLayout = new QHBoxLayout; + auto imgMainLayout = new QHBoxLayout; QLabel *imgLabel = new QLabel(this); QPixmap p(":/images/edit.png"); imgLabel->setPixmap(p); diff --git a/YACReaderLibrary/server/lib/httpserver/httplistener.cpp b/YACReaderLibrary/server/lib/httpserver/httplistener.cpp index 59596064..ac1a79a1 100644 --- a/YACReaderLibrary/server/lib/httpserver/httplistener.cpp +++ b/YACReaderLibrary/server/lib/httpserver/httplistener.cpp @@ -92,7 +92,7 @@ void HttpListener::incomingConnection(tSocketDescriptor socketDescriptor) { { // Reject the connection qDebug("HttpListener: Too many incoming connections"); - QTcpSocket* socket=new QTcpSocket(this); + auto* socket=new QTcpSocket(this); socket->setSocketDescriptor(socketDescriptor); connect(socket, SIGNAL(disconnected()), socket, SLOT(deleteLater())); socket->write("HTTP/1.1 503 too many connections\r\nConnection: close\r\n\r\nToo many connections\r\n"); diff --git a/YACReaderLibrary/server/requestmapper.cpp b/YACReaderLibrary/server/requestmapper.cpp index 16b56b12..c9b7dda8 100644 --- a/YACReaderLibrary/server/requestmapper.cpp +++ b/YACReaderLibrary/server/requestmapper.cpp @@ -59,7 +59,7 @@ void RequestMapper::loadSessionV1(HttpRequest &request, HttpResponse &response) HttpSession session = Static::sessionStore->getSession(request, response); if (session.contains("ySession")) //session is already alive check if it is needed to update comics { - YACReaderHttpSession *ySession = Static::yacreaderSessionStore->getYACReaderSessionHttpSession(session.getId()); + auto ySession = Static::yacreaderSessionStore->getYACReaderSessionHttpSession(session.getId()); QString postData = QString::fromUtf8(request.getBody()); @@ -85,7 +85,7 @@ void RequestMapper::loadSessionV1(HttpRequest &request, HttpResponse &response) } } } else { - YACReaderHttpSession *ySession = new YACReaderHttpSession(this); + auto ySession = new YACReaderHttpSession(this); Static::yacreaderSessionStore->addYACReaderHttpSession(session.getId(), ySession); @@ -121,11 +121,11 @@ void RequestMapper::loadSessionV2(HttpRequest &request, HttpResponse & /* respon return; } - YACReaderHttpSession *yRecoveredSession = Static::yacreaderSessionStore->getYACReaderSessionHttpSession(token); + auto yRecoveredSession = Static::yacreaderSessionStore->getYACReaderSessionHttpSession(token); if (yRecoveredSession == nullptr) //session is already alive check if it is needed to update comics { - YACReaderHttpSession *ySession = new YACReaderHttpSession(this); + auto ySession = new YACReaderHttpSession(this); Static::yacreaderSessionStore->addYACReaderHttpSession(token, ySession); } diff --git a/YACReaderLibrary/server/startup.cpp b/YACReaderLibrary/server/startup.cpp index b6ce2881..7cf632c2 100644 --- a/YACReaderLibrary/server/startup.cpp +++ b/YACReaderLibrary/server/startup.cpp @@ -53,7 +53,7 @@ void Startup::start() logger->installMsgHandler();*/ // Configure template loader and cache - QSettings *templateSettings = new QSettings(configFileName, QSettings::IniFormat, app); + auto *templateSettings = new QSettings(configFileName, QSettings::IniFormat, app); templateSettings->beginGroup("templates"); if (templateSettings->value("cacheSize").isNull()) @@ -74,7 +74,7 @@ void Startup::start() Static::templateLoader = new TemplateCache(templateSettings, app); // Configure session store - QSettings *sessionSettings = new QSettings(configFileName, QSettings::IniFormat, app); + auto *sessionSettings = new QSettings(configFileName, QSettings::IniFormat, app); sessionSettings->beginGroup("sessions"); if (sessionSettings->value("expirationTime").isNull()) @@ -85,7 +85,7 @@ void Startup::start() Static::yacreaderSessionStore = new YACReaderHttpSessionStore(Static::sessionStore, app); // Configure static file controller - QSettings *fileSettings = new QSettings(configFileName, QSettings::IniFormat, app); + auto *fileSettings = new QSettings(configFileName, QSettings::IniFormat, app); fileSettings->beginGroup("docroot"); QString basedocroot = "./server/docroot"; @@ -106,7 +106,7 @@ void Startup::start() // Configure and start the TCP listener qDebug("ServiceHelper: Starting service"); - QSettings *listenerSettings = new QSettings(configFileName, QSettings::IniFormat, app); + auto *listenerSettings = new QSettings(configFileName, QSettings::IniFormat, app); listenerSettings->beginGroup("listener"); if (listenerSettings->value("maxRequestSize").isNull()) diff --git a/YACReaderLibrary/server_config_dialog.cpp b/YACReaderLibrary/server_config_dialog.cpp index 1b0f14aa..1d8ed2c3 100644 --- a/YACReaderLibrary/server_config_dialog.cpp +++ b/YACReaderLibrary/server_config_dialog.cpp @@ -132,7 +132,7 @@ ServerConfigDialog::ServerConfigDialog(QWidget *parent) port->setValidator(validator); QWidget *portWidget = new QWidget(this); - QHBoxLayout *portWidgetLayout = new QHBoxLayout(this); + auto portWidgetLayout = new QHBoxLayout(this); portWidgetLayout->addWidget(port); portWidgetLayout->addWidget(accept); portWidgetLayout->setMargin(0); diff --git a/YACReaderLibrary/yacreader_local_server.cpp b/YACReaderLibrary/yacreader_local_server.cpp index 2f5ce90d..55891b22 100644 --- a/YACReaderLibrary/yacreader_local_server.cpp +++ b/YACReaderLibrary/yacreader_local_server.cpp @@ -44,7 +44,7 @@ void YACReaderLocalServer::sendResponse() //connect(clientConnection, SIGNAL(disconnected()),clientConnection, SLOT(deleteLater())); clientConnection->setParent(0); - YACReaderClientConnectionWorker *worker = new YACReaderClientConnectionWorker(clientConnection); + auto worker = new YACReaderClientConnectionWorker(clientConnection); if (worker != 0) { clientConnection->moveToThread(worker); connect(worker, SIGNAL(comicUpdated(quint64, ComicDB)), this, SIGNAL(comicUpdated(quint64, ComicDB))); diff --git a/YACReaderLibrary/yacreader_navigation_controller.cpp b/YACReaderLibrary/yacreader_navigation_controller.cpp index 86c2c584..d3438a1b 100644 --- a/YACReaderLibrary/yacreader_navigation_controller.cpp +++ b/YACReaderLibrary/yacreader_navigation_controller.cpp @@ -279,7 +279,7 @@ qulonglong YACReaderNavigationController::folderModelIndexToID(const QModelIndex if (!mi.isValid()) return 1; - FolderItem *folderItem = static_cast(mi.internalPointer()); + auto folderItem = static_cast(mi.internalPointer()); if (folderItem != 0) return folderItem->id;