1
mirror of https://invent.kde.org/network/falkon.git synced 2024-11-11 01:22:10 +01:00

Fix some clazy warnings

This commit is contained in:
Laurent Montel 2019-01-08 13:28:02 +01:00
parent 2528ed2163
commit 4de3e4c703
120 changed files with 722 additions and 722 deletions

View File

@ -257,7 +257,7 @@ FancyTabBar::FancyTabBar(QWidget* parent)
setLayout(layout);
// We use a zerotimer to keep the sidebar responsive
connect(&m_triggerTimer, SIGNAL(timeout()), this, SLOT(emitCurrentIndex()));
connect(&m_triggerTimer, &QTimer::timeout, this, &FancyTabBar::emitCurrentIndex);
}
FancyTabBar::~FancyTabBar()
@ -628,7 +628,7 @@ void FancyTabWidget::SetMode(Mode mode)
}
bar->setCurrentIndex(stack_->currentIndex());
connect(bar, SIGNAL(currentChanged(int)), SLOT(ShowWidget(int)));
connect(bar, &FancyTabBar::currentChanged, this, &FancyTabWidget::ShowWidget);
use_background_ = true;
@ -742,6 +742,6 @@ void FancyTabWidget::MakeTabBar(QTabBar::Shape shape, bool text, bool icons,
}
bar->setCurrentIndex(stack_->currentIndex());
connect(bar, SIGNAL(currentChanged(int)), SLOT(ShowWidget(int)));
connect(bar, &QTabBar::currentChanged, this, &FancyTabWidget::ShowWidget);
tab_bar_ = bar;
}

View File

@ -96,48 +96,48 @@ void LineEdit::init()
setWidgetSpacing(3);
connect(m_leftWidget, SIGNAL(sizeHintChanged()), this, SLOT(updateTextMargins()));
connect(m_rightWidget, SIGNAL(sizeHintChanged()), this, SLOT(updateTextMargins()));
connect(m_leftWidget, &SideWidget::sizeHintChanged, this, &LineEdit::updateTextMargins);
connect(m_rightWidget, &SideWidget::sizeHintChanged, this, &LineEdit::updateTextMargins);
QAction* undoAction = new QAction(QIcon::fromTheme(QSL("edit-undo")), tr("&Undo"), this);
undoAction->setShortcut(QKeySequence(QSL("Ctrl+Z")));
undoAction->setShortcutContext(Qt::WidgetWithChildrenShortcut);
connect(undoAction, SIGNAL(triggered()), SLOT(undo()));
connect(undoAction, &QAction::triggered, this, &QLineEdit::undo);
QAction* redoAction = new QAction(QIcon::fromTheme(QSL("edit-redo")), tr("&Redo"), this);
redoAction->setShortcut(QKeySequence(QSL("Ctrl+Shift+Z")));
redoAction->setShortcutContext(Qt::WidgetWithChildrenShortcut);
connect(redoAction, SIGNAL(triggered()), SLOT(redo()));
connect(redoAction, &QAction::triggered, this, &QLineEdit::redo);
QAction* cutAction = new QAction(QIcon::fromTheme(QSL("edit-cut")), tr("Cu&t"), this);
cutAction->setShortcut(QKeySequence(QSL("Ctrl+X")));
cutAction->setShortcutContext(Qt::WidgetWithChildrenShortcut);
connect(cutAction, SIGNAL(triggered()), SLOT(cut()));
connect(cutAction, &QAction::triggered, this, &QLineEdit::cut);
QAction* copyAction = new QAction(QIcon::fromTheme(QSL("edit-copy")), tr("&Copy"), this);
copyAction->setShortcut(QKeySequence(QSL("Ctrl+C")));
copyAction->setShortcutContext(Qt::WidgetWithChildrenShortcut);
connect(copyAction, SIGNAL(triggered()), SLOT(copy()));
connect(copyAction, &QAction::triggered, this, &QLineEdit::copy);
QAction* pasteAction = new QAction(QIcon::fromTheme(QSL("edit-paste")), tr("&Paste"), this);
pasteAction->setShortcut(QKeySequence(QSL("Ctrl+V")));
pasteAction->setShortcutContext(Qt::WidgetWithChildrenShortcut);
connect(pasteAction, SIGNAL(triggered()), SLOT(paste()));
connect(pasteAction, &QAction::triggered, this, &QLineEdit::paste);
QAction* pasteAndGoAction = new QAction(this);
pasteAndGoAction->setShortcut(QKeySequence(QSL("Ctrl+Shift+V")));
pasteAndGoAction->setShortcutContext(Qt::WidgetWithChildrenShortcut);
QAction* deleteAction = new QAction(QIcon::fromTheme(QSL("edit-delete")), tr("Delete"), this);
connect(deleteAction, SIGNAL(triggered()), SLOT(slotDelete()));
connect(deleteAction, &QAction::triggered, this, &LineEdit::slotDelete);
QAction* clearAllAction = new QAction(QIcon::fromTheme(QSL("edit-clear")), tr("Clear All"), this);
connect(clearAllAction, SIGNAL(triggered()), SLOT(clear()));
connect(clearAllAction, &QAction::triggered, this, &QLineEdit::clear);
QAction* selectAllAction = new QAction(QIcon::fromTheme(QSL("edit-select-all")), tr("Select All"), this);
selectAllAction->setShortcut(QKeySequence(QSL("Ctrl+A")));
selectAllAction->setShortcutContext(Qt::WidgetWithChildrenShortcut);
connect(selectAllAction, SIGNAL(triggered()), SLOT(selectAll()));
connect(selectAllAction, &QAction::triggered, this, &QLineEdit::selectAll);
m_editActions[Undo] = undoAction;
m_editActions[Redo] = redoAction;
@ -161,8 +161,8 @@ void LineEdit::init()
addAction(selectAllAction);
// Connections to update edit actions
connect(this, SIGNAL(textChanged(QString)), this, SLOT(updateActions()));
connect(this, SIGNAL(selectionChanged()), this, SLOT(updateActions()));
connect(this, &QLineEdit::textChanged, this, &LineEdit::updateActions);
connect(this, &QLineEdit::selectionChanged, this, &LineEdit::updateActions);
updateActions();
}

View File

@ -128,7 +128,7 @@ bool QtLocalPeer::isClient()
#endif
if (!res)
qWarning("QtSingleCoreApplication: listen on local socket failed, %s", qPrintable(server->errorString()));
QObject::connect(server, SIGNAL(newConnection()), SLOT(receiveConnection()));
QObject::connect(server, &QLocalServer::newConnection, this, &QtLocalPeer::receiveConnection);
return false;
}

View File

@ -137,7 +137,7 @@ void QtSingleApplication::sysInit(const QString &appId)
{
actWin = 0;
peer = new QtLocalPeer(this, appId);
connect(peer, SIGNAL(messageReceived(const QString&)), SIGNAL(messageReceived(const QString&)));
connect(peer, &QtLocalPeer::messageReceived, this, &QtSingleApplication::messageReceived);
}
@ -292,9 +292,9 @@ void QtSingleApplication::setActivationWindow(QWidget* aw, bool activateOnMessag
{
actWin = aw;
if (activateOnMessage)
connect(peer, SIGNAL(messageReceived(const QString&)), this, SLOT(activateWindow()));
connect(peer, &QtLocalPeer::messageReceived, this, &QtSingleApplication::activateWindow);
else
disconnect(peer, SIGNAL(messageReceived(const QString&)), this, SLOT(activateWindow()));
disconnect(peer, &QtLocalPeer::messageReceived, this, &QtSingleApplication::activateWindow);
}

View File

@ -61,7 +61,7 @@ void SqueezeLabelV2::contextMenuEvent(QContextMenuEvent* event)
}
QMenu menu;
QAction* act = menu.addAction(tr("Copy"), this, SLOT(copy()));
QAction* act = menu.addAction(tr("Copy"), this, &SqueezeLabelV2::copy);
act->setShortcut(QKeySequence(QSL("Ctrl+C")));
act->setEnabled(hasSelectedText());

View File

@ -46,22 +46,22 @@ AdBlockDialog::AdBlockDialog(QWidget* parent)
adblockCheckBox->setChecked(m_manager->isEnabled());
QMenu* menu = new QMenu(buttonOptions);
m_actionAddRule = menu->addAction(tr("Add Rule"), this, SLOT(addRule()));
m_actionRemoveRule = menu->addAction(tr("Remove Rule"), this, SLOT(removeRule()));
m_actionAddRule = menu->addAction(tr("Add Rule"), this, &AdBlockDialog::addRule);
m_actionRemoveRule = menu->addAction(tr("Remove Rule"), this, &AdBlockDialog::removeRule);
menu->addSeparator();
m_actionAddSubscription = menu->addAction(tr("Add Subscription"), this, SLOT(addSubscription()));
m_actionRemoveSubscription = menu->addAction(tr("Remove Subscription"), this, SLOT(removeSubscription()));
menu->addAction(tr("Update Subscriptions"), m_manager, SLOT(updateAllSubscriptions()));
m_actionAddSubscription = menu->addAction(tr("Add Subscription"), this, &AdBlockDialog::addSubscription);
m_actionRemoveSubscription = menu->addAction(tr("Remove Subscription"), this, &AdBlockDialog::removeSubscription);
menu->addAction(tr("Update Subscriptions"), m_manager, &AdBlockManager::updateAllSubscriptions);
menu->addSeparator();
menu->addAction(tr("Learn about writing rules..."), this, SLOT(learnAboutRules()));
menu->addAction(tr("Learn about writing rules..."), this, &AdBlockDialog::learnAboutRules);
buttonOptions->setMenu(menu);
connect(menu, SIGNAL(aboutToShow()), this, SLOT(aboutToShowMenu()));
connect(menu, &QMenu::aboutToShow, this, &AdBlockDialog::aboutToShowMenu);
connect(adblockCheckBox, SIGNAL(toggled(bool)), this, SLOT(enableAdBlock(bool)));
connect(search, SIGNAL(textChanged(QString)), this, SLOT(filterString(QString)));
connect(tabWidget, SIGNAL(currentChanged(int)), this, SLOT(currentChanged(int)));
connect(buttonBox, SIGNAL(accepted()), this, SLOT(close()));
connect(adblockCheckBox, &QAbstractButton::toggled, this, &AdBlockDialog::enableAdBlock);
connect(search, &QLineEdit::textChanged, this, &AdBlockDialog::filterString);
connect(tabWidget, &QTabWidget::currentChanged, this, &AdBlockDialog::currentChanged);
connect(buttonBox, &QDialogButtonBox::accepted, this, &QWidget::close);
load();
@ -181,5 +181,5 @@ void AdBlockDialog::load()
m_loaded = true;
QTimer::singleShot(50, this, SLOT(loadSubscriptions()));
QTimer::singleShot(50, this, &AdBlockDialog::loadSubscriptions);
}

View File

@ -154,13 +154,13 @@ void AdBlockIcon::clicked(ClickController *controller)
act->setCheckable(true);
act->setChecked(customList->containsFilter(hostFilter));
act->setData(hostFilter);
connect(act, SIGNAL(triggered()), this, SLOT(toggleCustomFilter()));
connect(act, &QAction::triggered, this, &AdBlockIcon::toggleCustomFilter);
act = menu->addAction(tr("Disable only on this page"));
act->setCheckable(true);
act->setChecked(customList->containsFilter(pageFilter));
act->setData(pageFilter);
connect(act, SIGNAL(triggered()), this, SLOT(toggleCustomFilter()));
connect(act, &QAction::triggered, this, &AdBlockIcon::toggleCustomFilter);
}
connect(menu, &QMenu::aboutToHide, this, [=]() {

View File

@ -217,8 +217,8 @@ AdBlockSubscription* AdBlockManager::addSubscription(const QString &title, const
subscription->loadSubscription(m_disabledRules);
m_subscriptions.insert(m_subscriptions.count() - 1, subscription);
connect(subscription, SIGNAL(subscriptionUpdated()), mApp, SLOT(reloadUserStyleSheet()));
connect(subscription, SIGNAL(subscriptionChanged()), this, SLOT(updateMatcher()));
connect(subscription, &AdBlockSubscription::subscriptionUpdated, mApp, &MainApplication::reloadUserStyleSheet);
connect(subscription, &AdBlockSubscription::subscriptionChanged, this, &AdBlockManager::updateMatcher);
return subscription;
}
@ -332,12 +332,12 @@ void AdBlockManager::load()
foreach (AdBlockSubscription* subscription, m_subscriptions) {
subscription->loadSubscription(m_disabledRules);
connect(subscription, SIGNAL(subscriptionUpdated()), mApp, SLOT(reloadUserStyleSheet()));
connect(subscription, SIGNAL(subscriptionChanged()), this, SLOT(updateMatcher()));
connect(subscription, &AdBlockSubscription::subscriptionUpdated, mApp, &MainApplication::reloadUserStyleSheet);
connect(subscription, &AdBlockSubscription::subscriptionChanged, this, &AdBlockManager::updateMatcher);
}
if (lastUpdate.addDays(5) < QDateTime::currentDateTime()) {
QTimer::singleShot(1000 * 60, this, SLOT(updateAllSubscriptions()));
QTimer::singleShot(1000 * 60, this, &AdBlockManager::updateAllSubscriptions);
}
#ifdef ADBLOCK_DEBUG

View File

@ -93,13 +93,13 @@ void AdBlockSubscription::loadSubscription(const QStringList &disabledRules)
QFile file(m_filePath);
if (!file.exists()) {
QTimer::singleShot(0, this, SLOT(updateSubscription()));
QTimer::singleShot(0, this, &AdBlockSubscription::updateSubscription);
return;
}
if (!file.open(QFile::ReadOnly)) {
qWarning() << "AdBlockSubscription::" << __FUNCTION__ << "Unable to open adblock file for reading" << m_filePath;
QTimer::singleShot(0, this, SLOT(updateSubscription()));
QTimer::singleShot(0, this, &AdBlockSubscription::updateSubscription);
return;
}
@ -112,7 +112,7 @@ void AdBlockSubscription::loadSubscription(const QStringList &disabledRules)
if (!header.startsWith(QLatin1String("[Adblock")) || m_title.isEmpty()) {
qWarning() << "AdBlockSubscription::" << __FUNCTION__ << "invalid format of adblock file" << m_filePath;
QTimer::singleShot(0, this, SLOT(updateSubscription()));
QTimer::singleShot(0, this, &AdBlockSubscription::updateSubscription);
return;
}
@ -133,7 +133,7 @@ void AdBlockSubscription::loadSubscription(const QStringList &disabledRules)
// Initial update
if (m_rules.isEmpty() && !m_updated) {
QTimer::singleShot(0, this, SLOT(updateSubscription()));
QTimer::singleShot(0, this, &AdBlockSubscription::updateSubscription);
}
}

View File

@ -36,10 +36,10 @@ AdBlockTreeWidget::AdBlockTreeWidget(AdBlockSubscription* subscription, QWidget*
setAlternatingRowColors(true);
setLayoutDirection(Qt::LeftToRight);
connect(this, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(contextMenuRequested(QPoint)));
connect(this, &QWidget::customContextMenuRequested, this, &AdBlockTreeWidget::contextMenuRequested);
connect(this, SIGNAL(itemChanged(QTreeWidgetItem*,int)), this, SLOT(itemChanged(QTreeWidgetItem*)));
connect(m_subscription, SIGNAL(subscriptionUpdated()), this, SLOT(subscriptionUpdated()));
connect(m_subscription, SIGNAL(subscriptionError(QString)), this, SLOT(subscriptionError(QString)));
connect(m_subscription, &AdBlockSubscription::subscriptionUpdated, this, &AdBlockTreeWidget::subscriptionUpdated);
connect(m_subscription, &AdBlockSubscription::subscriptionError, this, &AdBlockTreeWidget::subscriptionError);
}
AdBlockSubscription* AdBlockTreeWidget::subscription() const
@ -77,9 +77,9 @@ void AdBlockTreeWidget::contextMenuRequested(const QPoint &pos)
}
QMenu menu;
menu.addAction(tr("Add Rule"), this, SLOT(addRule()));
menu.addAction(tr("Add Rule"), this, &AdBlockTreeWidget::addRule);
menu.addSeparator();
QAction* deleteAction = menu.addAction(tr("Remove Rule"), this, SLOT(removeRule()));
QAction* deleteAction = menu.addAction(tr("Remove Rule"), this, &AdBlockTreeWidget::removeRule);
if (!item->parent()) {
deleteAction->setDisabled(true);

View File

@ -211,11 +211,11 @@ BrowserWindow::BrowserWindow(Qz::BrowserWindowType type, const QUrl &startUrl)
m_hideNavigationTimer = new QTimer(this);
m_hideNavigationTimer->setInterval(1000);
m_hideNavigationTimer->setSingleShot(true);
connect(m_hideNavigationTimer, SIGNAL(timeout()), this, SLOT(hideNavigationSlot()));
connect(m_hideNavigationTimer, &QTimer::timeout, this, &BrowserWindow::hideNavigationSlot);
connect(mApp, SIGNAL(settingsReloaded()), this, SLOT(loadSettings()));
connect(mApp, &MainApplication::settingsReloaded, this, &BrowserWindow::loadSettings);
QTimer::singleShot(0, this, SLOT(postLaunch()));
QTimer::singleShot(0, this, &BrowserWindow::postLaunch);
if (mApp->isPrivate()) {
QzTools::setWmClass(QSL("Falkon Browser (Private Window)"), this);
@ -463,22 +463,22 @@ void BrowserWindow::setupMenu()
// Setup other shortcuts
QShortcut* reloadBypassCacheAction = new QShortcut(QKeySequence(QSL("Ctrl+F5")), this);
QShortcut* reloadBypassCacheAction2 = new QShortcut(QKeySequence(QSL("Ctrl+Shift+R")), this);
connect(reloadBypassCacheAction, SIGNAL(activated()), this, SLOT(reloadBypassCache()));
connect(reloadBypassCacheAction2, SIGNAL(activated()), this, SLOT(reloadBypassCache()));
connect(reloadBypassCacheAction, &QShortcut::activated, this, &BrowserWindow::reloadBypassCache);
connect(reloadBypassCacheAction2, &QShortcut::activated, this, &BrowserWindow::reloadBypassCache);
QShortcut* closeTabAction = new QShortcut(QKeySequence(QSL("Ctrl+W")), this);
QShortcut* closeTabAction2 = new QShortcut(QKeySequence(QSL("Ctrl+F4")), this);
connect(closeTabAction, SIGNAL(activated()), this, SLOT(closeTab()));
connect(closeTabAction2, SIGNAL(activated()), this, SLOT(closeTab()));
connect(closeTabAction, &QShortcut::activated, this, &BrowserWindow::closeTab);
connect(closeTabAction2, &QShortcut::activated, this, &BrowserWindow::closeTab);
QShortcut* reloadAction = new QShortcut(QKeySequence(QSL("Ctrl+R")), this);
connect(reloadAction, SIGNAL(activated()), this, SLOT(reload()));
connect(reloadAction, &QShortcut::activated, this, &BrowserWindow::reload);
QShortcut* openLocationAction = new QShortcut(QKeySequence(QSL("Alt+D")), this);
connect(openLocationAction, SIGNAL(activated()), this, SLOT(openLocation()));
connect(openLocationAction, &QShortcut::activated, this, &BrowserWindow::openLocation);
QShortcut* inspectorAction = new QShortcut(QKeySequence(QSL("F12")), this);
connect(inspectorAction, SIGNAL(activated()), this, SLOT(toggleWebInspector()));
connect(inspectorAction, &QShortcut::activated, this, &BrowserWindow::toggleWebInspector);
QShortcut* restoreClosedWindow = new QShortcut(QKeySequence(QSL("Ctrl+Shift+N")), this);
connect(restoreClosedWindow, &QShortcut::activated, mApp->closedWindowsManager(), &ClosedWindowsManager::restoreClosedWindow);
@ -503,7 +503,7 @@ QAction* BrowserWindow::createEncodingAction(const QString &codecName,
QAction* action = new QAction(codecName, menu);
action->setData(codecName);
action->setCheckable(true);
connect(action, SIGNAL(triggered()), this, SLOT(changeEncoding()));
connect(action, &QAction::triggered, this, &BrowserWindow::changeEncoding);
if (activeCodecName.compare(codecName, Qt::CaseInsensitive) == 0) {
action->setChecked(true);
}
@ -1045,16 +1045,16 @@ void BrowserWindow::createToolbarsMenu(QMenu* menu)
QAction* action;
#ifndef Q_OS_MACOS
action = menu->addAction(tr("&Menu Bar"), this, SLOT(toggleShowMenubar()));
action = menu->addAction(tr("&Menu Bar"), this, &BrowserWindow::toggleShowMenubar);
action->setCheckable(true);
action->setChecked(menuBar()->isVisible());
#endif
action = menu->addAction(tr("&Navigation Toolbar"), this, SLOT(toggleShowNavigationToolbar()));
action = menu->addAction(tr("&Navigation Toolbar"), this, &BrowserWindow::toggleShowNavigationToolbar);
action->setCheckable(true);
action->setChecked(m_navigationToolbar->isVisible());
action = menu->addAction(tr("&Bookmarks Toolbar"), this, SLOT(toggleShowBookmarksToolbar()));
action = menu->addAction(tr("&Bookmarks Toolbar"), this, &BrowserWindow::toggleShowBookmarksToolbar);
action->setCheckable(true);
action->setChecked(Settings().value(QSL("Browser-View-Settings/showBookmarksToolbar")).toBool());

View File

@ -111,8 +111,8 @@ MainApplication::MainApplication(int &argc, char** argv)
setAttribute(Qt::AA_UseHighDpiPixmaps);
setAttribute(Qt::AA_DontCreateNativeWidgetSiblings);
setApplicationName(QLatin1String("falkon"));
setOrganizationDomain(QLatin1String("org.kde"));
setApplicationName(QStringLiteral("falkon"));
setOrganizationDomain(QStringLiteral("org.kde"));
setWindowIcon(QIcon::fromTheme(QSL("falkon"), QIcon(QSL(":icons/falkon.svg"))));
setDesktopFileName(QSL("org.kde.falkon"));
@ -165,18 +165,18 @@ MainApplication::MainApplication(int &argc, char** argv)
m_isPortable = true;
break;
case Qz::CL_NewTab:
messages.append(QLatin1String("ACTION:NewTab"));
messages.append(QStringLiteral("ACTION:NewTab"));
m_postLaunchActions.append(OpenNewTab);
break;
case Qz::CL_NewWindow:
messages.append(QLatin1String("ACTION:NewWindow"));
messages.append(QStringLiteral("ACTION:NewWindow"));
break;
case Qz::CL_ToggleFullScreen:
messages.append(QLatin1String("ACTION:ToggleFullScreen"));
messages.append(QStringLiteral("ACTION:ToggleFullScreen"));
m_postLaunchActions.append(ToggleFullScreen);
break;
case Qz::CL_ShowDownloadManager:
messages.append(QLatin1String("ACTION:ShowDownloadManager"));
messages.append(QStringLiteral("ACTION:ShowDownloadManager"));
m_postLaunchActions.append(OpenDownloadManager);
break;
case Qz::CL_StartPrivateBrowsing:
@ -221,7 +221,7 @@ MainApplication::MainApplication(int &argc, char** argv)
// Don't start single application in private browsing
if (!isPrivate()) {
QString appId = QLatin1String("FalkonWebBrowser");
QString appId = QStringLiteral("FalkonWebBrowser");
if (isPortable()) {
appId.append(QLatin1String("Portable"));
@ -248,7 +248,7 @@ MainApplication::MainApplication(int &argc, char** argv)
// If there is nothing to tell other instance, we need to at least wake it
if (messages.isEmpty()) {
messages.append(QLatin1String(" "));
messages.append(QStringLiteral(" "));
}
if (isRunning()) {
@ -289,7 +289,7 @@ MainApplication::MainApplication(int &argc, char** argv)
if (!isPrivate() && !isTestModeEnabled()) {
m_sessionManager = new SessionManager(this);
m_autoSaver = new AutoSaver(this);
connect(m_autoSaver, SIGNAL(save()), m_sessionManager, SLOT(autoSaveLastSession()));
connect(m_autoSaver, &AutoSaver::save, m_sessionManager, &SessionManager::autoSaveLastSession);
Settings settings;
settings.beginGroup(QSL("SessionRestore"));
@ -324,7 +324,7 @@ MainApplication::MainApplication(int &argc, char** argv)
BrowserWindow* window = createWindow(Qz::BW_FirstAppWindow, startUrl);
connect(window, SIGNAL(startingCompleted()), this, SLOT(restoreOverrideCursor()));
connect(this, SIGNAL(focusChanged(QWidget*,QWidget*)), this, SLOT(onFocusChanged()));
connect(this, &QApplication::focusChanged, this, &MainApplication::onFocusChanged);
if (!isPrivate() && !isTestModeEnabled()) {
#ifndef DISABLE_CHECK_UPDATES
@ -353,9 +353,9 @@ MainApplication::MainApplication(int &argc, char** argv)
QSettings::setPath(QSettings::IniFormat, QSettings::UserScope, DataPaths::currentProfilePath());
connect(this, SIGNAL(messageReceived(QString)), this, SLOT(messageReceived(QString)));
connect(this, SIGNAL(aboutToQuit()), this, SLOT(saveSettings()));
connect(this, &QCoreApplication::aboutToQuit, this, &MainApplication::saveSettings);
QTimer::singleShot(0, this, SLOT(postLaunch()));
QTimer::singleShot(0, this, &MainApplication::postLaunch);
}
MainApplication::~MainApplication()
@ -426,7 +426,7 @@ BrowserWindow* MainApplication::createWindow(Qz::BrowserWindowType type, const Q
}
BrowserWindow* window = new BrowserWindow(type, startUrl);
connect(window, SIGNAL(destroyed(QObject*)), this, SLOT(windowDestroyed(QObject*)));
connect(window, &QObject::destroyed, this, &MainApplication::windowDestroyed);
m_windows.prepend(window);
return window;

View File

@ -466,24 +466,24 @@ void MainMenu::init()
// Standard actions - needed on Mac to be placed correctly in "application" menu
QAction* action = new QAction(QIcon::fromTheme(QSL("help-about")), tr("&About Falkon"), this);
action->setMenuRole(QAction::AboutRole);
connect(action, SIGNAL(triggered()), this, SLOT(showAboutDialog()));
connect(action, &QAction::triggered, this, &MainMenu::showAboutDialog);
m_actions[QSL("Standard/About")] = action;
action = new QAction(IconProvider::settingsIcon(), tr("Pr&eferences"), this);
action->setMenuRole(QAction::PreferencesRole);
action->setShortcut(QKeySequence(QKeySequence::Preferences));
connect(action, SIGNAL(triggered()), this, SLOT(showPreferences()));
connect(action, &QAction::triggered, this, &MainMenu::showPreferences);
m_actions[QSL("Standard/Preferences")] = action;
action = new QAction(QIcon::fromTheme(QSL("application-exit")), tr("Quit"), this);
action->setMenuRole(QAction::QuitRole);
// shortcut set from browserwindow
connect(action, SIGNAL(triggered()), this, SLOT(quitApplication()));
connect(action, &QAction::triggered, this, &MainMenu::quitApplication);
m_actions[QSL("Standard/Quit")] = action;
// File menu
m_menuFile = new QMenu(tr("&File"));
connect(m_menuFile, SIGNAL(aboutToShow()), this, SLOT(aboutToShowFileMenu()));
connect(m_menuFile, &QMenu::aboutToShow, this, &MainMenu::aboutToShowFileMenu);
ADD_ACTION("File/NewTab", m_menuFile, IconProvider::newTabIcon(), tr("New Tab"), SLOT(newTab()), "Ctrl+T");
ADD_ACTION("File/NewWindow", m_menuFile, IconProvider::newWindowIcon(), tr("&New Window"), SLOT(newWindow()), "Ctrl+N");
@ -498,7 +498,7 @@ void MainMenu::init()
connect(sessionsSubmenu, SIGNAL(aboutToShow()), mApp->sessionManager(), SLOT(aboutToShowSessionsMenu()));
m_menuFile->addMenu(sessionsSubmenu);
action = new QAction(tr("Session Manager"), this);
connect(action, SIGNAL(triggered()), mApp->sessionManager(), SLOT(openSessionManagerDialog()));
connect(action, &QAction::triggered, mApp->sessionManager(), &SessionManager::openSessionManagerDialog);
m_actions[QSL("File/SessionManager")] = action;
m_menuFile->addAction(action);
m_menuFile->addSeparator();
@ -512,7 +512,7 @@ void MainMenu::init()
// Edit menu
m_menuEdit = new QMenu(tr("&Edit"));
connect(m_menuEdit, SIGNAL(aboutToShow()), this, SLOT(aboutToShowEditMenu()));
connect(m_menuEdit, &QMenu::aboutToShow, this, &MainMenu::aboutToShowEditMenu);
ADD_ACTION("Edit/Undo", m_menuEdit, QIcon::fromTheme(QSL("edit-undo")), tr("&Undo"), SLOT(editUndo()), "Ctrl+Z");
action->setShortcutContext(Qt::WidgetShortcut);
@ -534,14 +534,14 @@ void MainMenu::init()
// View menu
m_menuView = new QMenu(tr("&View"));
connect(m_menuView, SIGNAL(aboutToShow()), this, SLOT(aboutToShowViewMenu()));
connect(m_menuView, &QMenu::aboutToShow, this, &MainMenu::aboutToShowViewMenu);
QMenu* toolbarsMenu = new QMenu(tr("Toolbars"));
connect(toolbarsMenu, SIGNAL(aboutToShow()), this, SLOT(aboutToShowToolbarsMenu()));
connect(toolbarsMenu, &QMenu::aboutToShow, this, &MainMenu::aboutToShowToolbarsMenu);
QMenu* sidebarMenu = new QMenu(tr("Sidebar"));
connect(sidebarMenu, SIGNAL(aboutToShow()), this, SLOT(aboutToShowSidebarsMenu()));
connect(sidebarMenu, &QMenu::aboutToShow, this, &MainMenu::aboutToShowSidebarsMenu);
QMenu* encodingMenu = new QMenu(tr("Character &Encoding"));
connect(encodingMenu, SIGNAL(aboutToShow()), this, SLOT(aboutToShowEncodingMenu()));
connect(encodingMenu, &QMenu::aboutToShow, this, &MainMenu::aboutToShowEncodingMenu);
// Create menus to make shortcuts available even before first showing the menu
m_window->createToolbarsMenu(toolbarsMenu);
@ -566,7 +566,7 @@ void MainMenu::init()
// Tools menu
m_menuTools = new QMenu(tr("&Tools"));
connect(m_menuTools, SIGNAL(aboutToShow()), this, SLOT(aboutToShowToolsMenu()));
connect(m_menuTools, &QMenu::aboutToShow, this, &MainMenu::aboutToShowToolsMenu);
ADD_ACTION("Tools/WebSearch", m_menuTools, QIcon::fromTheme(QSL("edit-find")), tr("&Web Search"), SLOT(webSearch()), "Ctrl+K");
ADD_ACTION("Tools/SiteInfo", m_menuTools, QIcon::fromTheme(QSL("dialog-information")), tr("Site &Info"), SLOT(showSiteInfo()), "Ctrl+I");
@ -611,7 +611,7 @@ void MainMenu::init()
// Other actions
action = new QAction(QIcon::fromTheme(QSL("user-trash")), tr("Restore &Closed Tab"), this);
action->setShortcut(QKeySequence(QSL("Ctrl+Shift+T")));
connect(action, SIGNAL(triggered()), this, SLOT(restoreClosedTab()));
connect(action, &QAction::triggered, this, &MainMenu::restoreClosedTab);
m_actions[QSL("Other/RestoreClosedTab")] = action;
#ifdef Q_OS_MACOS

View File

@ -44,7 +44,7 @@ void ProfileManager::initConfigDir()
migrateFromQupZilla();
}
if (QFileInfo::exists(dir.filePath(QLatin1String("profiles/profiles.ini")))) {
if (QFileInfo::exists(dir.filePath(QStringLiteral("profiles/profiles.ini")))) {
return;
}
@ -54,22 +54,22 @@ void ProfileManager::initConfigDir()
dir.mkpath(dir.absolutePath());
}
dir.mkdir(QLatin1String("profiles"));
dir.cd(QLatin1String("profiles"));
dir.mkdir(QStringLiteral("profiles"));
dir.cd(QStringLiteral("profiles"));
// $Config/profiles
QFile(dir.filePath(QLatin1String("profiles.ini"))).remove();
QFile(QLatin1String(":data/profiles.ini")).copy(dir.filePath(QLatin1String("profiles.ini")));
QFile(dir.filePath(QLatin1String("profiles.ini"))).setPermissions(QFile::ReadUser | QFile::WriteUser);
QFile(dir.filePath(QStringLiteral("profiles.ini"))).remove();
QFile(QStringLiteral(":data/profiles.ini")).copy(dir.filePath(QStringLiteral("profiles.ini")));
QFile(dir.filePath(QStringLiteral("profiles.ini"))).setPermissions(QFile::ReadUser | QFile::WriteUser);
dir.mkdir(QLatin1String("default"));
dir.cd(QLatin1String("default"));
dir.mkdir(QStringLiteral("default"));
dir.cd(QStringLiteral("default"));
// $Config/profiles/default
QFile(QLatin1String(":data/bookmarks.json")).copy(dir.filePath(QLatin1String("bookmarks.json")));
QFile(dir.filePath(QLatin1String("bookmarks.json"))).setPermissions(QFile::ReadUser | QFile::WriteUser);
QFile(QStringLiteral(":data/bookmarks.json")).copy(dir.filePath(QStringLiteral("bookmarks.json")));
QFile(dir.filePath(QStringLiteral("bookmarks.json"))).setPermissions(QFile::ReadUser | QFile::WriteUser);
QFile versionFile(dir.filePath(QLatin1String("version")));
QFile versionFile(dir.filePath(QStringLiteral("version")));
versionFile.open(QFile::WriteOnly);
versionFile.write(Qz::VERSION);
versionFile.close();
@ -105,7 +105,7 @@ int ProfileManager::createProfile(const QString &profileName)
dir.cd(profileName);
QFile versionFile(dir.filePath(QLatin1String("version")));
QFile versionFile(dir.filePath(QStringLiteral("version")));
versionFile.open(QFile::WriteOnly);
versionFile.write(Qz::VERSION);
versionFile.close();
@ -136,14 +136,14 @@ QString ProfileManager::currentProfile()
QString ProfileManager::startingProfile()
{
QSettings settings(DataPaths::path(DataPaths::Profiles) + QLatin1String("/profiles.ini"), QSettings::IniFormat);
return settings.value(QLatin1String("Profiles/startProfile"), QLatin1String("default")).toString();
return settings.value(QStringLiteral("Profiles/startProfile"), QLatin1String("default")).toString();
}
// static
void ProfileManager::setStartingProfile(const QString &profileName)
{
QSettings settings(DataPaths::path(DataPaths::Profiles) + QLatin1String("/profiles.ini"), QSettings::IniFormat);
settings.setValue(QLatin1String("Profiles/startProfile"), profileName);
settings.setValue(QStringLiteral("Profiles/startProfile"), profileName);
}
// static
@ -162,7 +162,7 @@ void ProfileManager::updateCurrentProfile()
newDir.mkdir(profileDir.dirName());
}
QFile versionFile(profileDir.filePath(QLatin1String("version")));
QFile versionFile(profileDir.filePath(QStringLiteral("version")));
// If file exists, just update the profile to current version
if (versionFile.exists()) {
@ -198,18 +198,18 @@ void ProfileManager::updateProfile(const QString &current, const QString &profil
return;
}
if (prof < Updater::Version("1.9.0")) {
if (prof < Updater::Version(QStringLiteral("1.9.0"))) {
std::cout << "Falkon: Using profile from QupZilla " << qPrintable(profile) << " is not supported!" << std::endl;
return;
}
// No change in 2.0
if (prof < Updater::Version("2.9.99")) {
if (prof < Updater::Version(QStringLiteral("2.9.99"))) {
return;
}
// No change in 3.0
if (prof < Updater::Version("3.0.99")) {
if (prof < Updater::Version(QStringLiteral("3.0.99"))) {
return;
}
}
@ -218,10 +218,10 @@ void ProfileManager::copyDataToProfile()
{
QDir profileDir(DataPaths::currentProfilePath());
QFile browseData(profileDir.filePath(QLatin1String("browsedata.db")));
QFile browseData(profileDir.filePath(QStringLiteral("browsedata.db")));
if (browseData.exists()) {
const QString browseDataBackup = QzTools::ensureUniqueFilename(profileDir.filePath(QLatin1String("browsedata-backup.db")));
const QString browseDataBackup = QzTools::ensureUniqueFilename(profileDir.filePath(QStringLiteral("browsedata-backup.db")));
browseData.copy(browseDataBackup);
browseData.remove();
@ -245,7 +245,7 @@ void ProfileManager::copyDataToProfile()
const QString text = "Incompatible profile version has been detected. To avoid losing your profile data, they were "
"backed up in following file:<br/><br/><b>" + browseDataBackup + "<br/></b>";
QMessageBox::warning(0, "Falkon: Incompatible profile version", text);
QMessageBox::warning(0, QStringLiteral("Falkon: Incompatible profile version"), text);
}
}
@ -274,14 +274,14 @@ void ProfileManager::migrateFromQupZilla()
void ProfileManager::connectDatabase()
{
QSqlDatabase db = QSqlDatabase::addDatabase(QLatin1String("QSQLITE"));
QSqlDatabase db = QSqlDatabase::addDatabase(QStringLiteral("QSQLITE"));
if (!db.isValid()) {
qCritical() << "Qt sqlite database driver is missing! Continuing without database....";
return;
}
if (mApp->isPrivate()) {
db.setConnectOptions("QSQLITE_OPEN_READONLY");
db.setConnectOptions(QStringLiteral("QSQLITE_OPEN_READONLY"));
}
db.setDatabaseName(DataPaths::currentProfilePath() + QLatin1String("/browsedata.db"));

View File

@ -58,9 +58,9 @@ PasswordManager* AutoFill::passwordManager() const
void AutoFill::loadSettings()
{
Settings settings;
settings.beginGroup("Web-Browser-Settings");
m_isStoring = settings.value("SavePasswordsOnSites", true).toBool();
m_isAutoComplete = settings.value("AutoCompletePasswords", true).toBool();
settings.beginGroup(QStringLiteral("Web-Browser-Settings"));
m_isStoring = settings.value(QStringLiteral("SavePasswordsOnSites"), true).toBool();
m_isAutoComplete = settings.value(QStringLiteral("AutoCompletePasswords"), true).toBool();
settings.endGroup();
}
@ -85,7 +85,7 @@ bool AutoFill::isStoringEnabled(const QUrl &url)
}
QSqlQuery query(SqlDatabase::instance()->database());
query.prepare("SELECT count(id) FROM autofill_exceptions WHERE server=?");
query.prepare(QStringLiteral("SELECT count(id) FROM autofill_exceptions WHERE server=?"));
query.addBindValue(server);
query.exec();
@ -104,7 +104,7 @@ void AutoFill::blockStoringforUrl(const QUrl &url)
}
QSqlQuery query(SqlDatabase::instance()->database());
query.prepare("INSERT INTO autofill_exceptions (server) VALUES (?)");
query.prepare(QStringLiteral("INSERT INTO autofill_exceptions (server) VALUES (?)"));
query.addBindValue(server);
query.exec();
}
@ -253,26 +253,26 @@ QByteArray AutoFill::exportPasswords()
stream.setAutoFormatting(true);
stream.writeStartDocument();
stream.writeStartElement("passwords");
stream.writeAttribute("version", "1.0");
stream.writeStartElement(QStringLiteral("passwords"));
stream.writeAttribute(QStringLiteral("version"), QStringLiteral("1.0"));
QVector<PasswordEntry> entries = m_manager->getAllEntries();
foreach (const PasswordEntry &entry, entries) {
stream.writeStartElement("entry");
stream.writeTextElement("server", entry.host);
stream.writeTextElement("username", entry.username);
stream.writeTextElement("password", entry.password);
stream.writeTextElement("data", entry.data);
stream.writeStartElement(QStringLiteral("entry"));
stream.writeTextElement(QStringLiteral("server"), entry.host);
stream.writeTextElement(QStringLiteral("username"), entry.username);
stream.writeTextElement(QStringLiteral("password"), entry.password);
stream.writeTextElement(QStringLiteral("data"), entry.data);
stream.writeEndElement();
}
QSqlQuery query(SqlDatabase::instance()->database());
query.prepare("SELECT server FROM autofill_exceptions");
query.prepare(QStringLiteral("SELECT server FROM autofill_exceptions"));
query.exec();
while (query.next()) {
stream.writeStartElement("exception");
stream.writeTextElement("server", query.value(0).toString());
stream.writeStartElement(QStringLiteral("exception"));
stream.writeTextElement(QStringLiteral("server"), query.value(0).toString());
stream.writeEndElement();
}
@ -345,12 +345,12 @@ bool AutoFill::importPasswords(const QByteArray &data)
if (!server.isEmpty()) {
QSqlQuery query(SqlDatabase::instance()->database());
query.prepare("SELECT id FROM autofill_exceptions WHERE server=?");
query.prepare(QStringLiteral("SELECT id FROM autofill_exceptions WHERE server=?"));
query.addBindValue(server);
query.exec();
if (!query.next()) {
query.prepare("INSERT INTO autofill_exceptions (server) VALUES (?)");
query.prepare(QStringLiteral("INSERT INTO autofill_exceptions (server) VALUES (?)"));
query.addBindValue(server);
query.exec();
}

View File

@ -29,7 +29,7 @@ AutoFillIcon::AutoFillIcon(QWidget* parent)
setToolTip(AutoFillWidget::tr("Choose username to login"));
setFocusPolicy(Qt::ClickFocus);
connect(this, SIGNAL(clicked(QPoint)), this, SLOT(iconClicked()));
connect(this, &ClickableLabel::clicked, this, &AutoFillIcon::iconClicked);
}
void AutoFillIcon::setWebView(WebView* view)

View File

@ -58,8 +58,8 @@ AutoFillNotification::AutoFillNotification(const QUrl &url, const PageFormData &
}
connect(ui->update, SIGNAL(clicked()), this, SLOT(update()));
connect(ui->remember, SIGNAL(clicked()), this, SLOT(remember()));
connect(ui->never, SIGNAL(clicked()), this, SLOT(never()));
connect(ui->remember, &QAbstractButton::clicked, this, &AutoFillNotification::remember);
connect(ui->never, &QAbstractButton::clicked, this, &AutoFillNotification::never);
connect(ui->notnow, SIGNAL(clicked()), this, SLOT(hide()));
connect(ui->closeButton, SIGNAL(clicked()), this, SLOT(hide()));

View File

@ -517,8 +517,8 @@ MasterPasswordDialog::MasterPasswordDialog(DatabaseEncryptedPasswordBackend* bac
ui->currentPassword->setVisible(m_backend->isMasterPasswordSetted());
ui->labelCurrentPassword->setVisible(m_backend->isMasterPasswordSetted());
connect(ui->setMasterPassword, SIGNAL(clicked()), this, SLOT(showSetMasterPasswordPage()));
connect(ui->clearMasterPassword, SIGNAL(clicked()), this, SLOT(clearMasterPasswordAndConvert()));
connect(ui->setMasterPassword, &QAbstractButton::clicked, this, &MasterPasswordDialog::showSetMasterPasswordPage);
connect(ui->clearMasterPassword, &QAbstractButton::clicked, this, &MasterPasswordDialog::clearMasterPasswordAndConvert);
connect(ui->buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
connect(ui->buttonBoxMasterPassword, SIGNAL(rejected()), this, SLOT(reject()));
connect(ui->buttonBoxMasterPassword, SIGNAL(accepted()), this, SLOT(accept()));
@ -531,7 +531,7 @@ MasterPasswordDialog::~MasterPasswordDialog()
void MasterPasswordDialog::delayedExec()
{
QTimer::singleShot(0, this, SLOT(exec()));
QTimer::singleShot(0, this, &QDialog::exec);
}
void MasterPasswordDialog::accept()
@ -689,9 +689,9 @@ AskMasterPassword::AskMasterPassword(DatabaseEncryptedPasswordBackend* backend,
verticalLayout->addWidget(m_buttonBox);
setLayout(verticalLayout);
connect(m_lineEdit, SIGNAL(returnPressed()), this, SLOT(verifyPassword()));
connect(m_buttonBox, SIGNAL(accepted()), this, SLOT(verifyPassword()));
connect(m_buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
connect(m_lineEdit, &QLineEdit::returnPressed, this, &AskMasterPassword::verifyPassword);
connect(m_buttonBox, &QDialogButtonBox::accepted, this, &AskMasterPassword::verifyPassword);
connect(m_buttonBox, &QDialogButtonBox::rejected, this, &QDialog::reject);
setAttribute(Qt::WA_DeleteOnClose);
}

View File

@ -34,7 +34,7 @@ Bookmarks::Bookmarks(QObject* parent)
, m_autoSaver(nullptr)
{
m_autoSaver = new AutoSaver(this);
connect(m_autoSaver, SIGNAL(save()), this, SLOT(saveSettings()));
connect(m_autoSaver, &AutoSaver::save, this, &Bookmarks::saveSettings);
init();
loadSettings();

View File

@ -33,9 +33,9 @@ BookmarksExportDialog::BookmarksExportDialog(QWidget* parent)
init();
connect(ui->chooseOutput, SIGNAL(clicked()), this, SLOT(setPath()));
connect(ui->buttonBox, SIGNAL(accepted()), this, SLOT(exportBookmarks()));
connect(ui->buttonBox, SIGNAL(rejected()), this, SLOT(close()));
connect(ui->chooseOutput, &QAbstractButton::clicked, this, &BookmarksExportDialog::setPath);
connect(ui->buttonBox, &QDialogButtonBox::accepted, this, &BookmarksExportDialog::exportBookmarks);
connect(ui->buttonBox, &QDialogButtonBox::rejected, this, &QWidget::close);
}
BookmarksExportDialog::~BookmarksExportDialog()

View File

@ -35,7 +35,7 @@ QString HtmlExporter::getPath(QWidget* parent)
{
const QString defaultPath = QDir::homePath() + QLatin1String("/bookmarks.html");
const QString filter = BookmarksExporter::tr("HTML Bookmarks") + QL1S(" (.html)");
m_path = QzTools::getSaveFileName("HtmlExporter", parent, BookmarksExporter::tr("Choose file..."), defaultPath, filter);
m_path = QzTools::getSaveFileName(QStringLiteral("HtmlExporter"), parent, BookmarksExporter::tr("Choose file..."), defaultPath, filter);
return m_path;
}

View File

@ -44,10 +44,10 @@ BookmarksImportDialog::BookmarksImportDialog(QWidget* parent)
ui->browserList->setCurrentRow(0);
ui->treeView->setItemDelegate(new BookmarksItemDelegate(ui->treeView));
connect(ui->nextButton, SIGNAL(clicked()), this, SLOT(nextPage()));
connect(ui->backButton, SIGNAL(clicked()), this, SLOT(previousPage()));
connect(ui->chooseFile, SIGNAL(clicked()), this, SLOT(setFile()));
connect(ui->cancelButton, SIGNAL(rejected()), this, SLOT(close()));
connect(ui->nextButton, &QAbstractButton::clicked, this, &BookmarksImportDialog::nextPage);
connect(ui->backButton, &QAbstractButton::clicked, this, &BookmarksImportDialog::previousPage);
connect(ui->chooseFile, &QAbstractButton::clicked, this, &BookmarksImportDialog::setFile);
connect(ui->cancelButton, &QDialogButtonBox::rejected, this, &QWidget::close);
#ifndef Q_OS_WIN
ui->browserList->setItemHidden(ui->browserList->item(IE), true);

View File

@ -54,7 +54,7 @@ QString FirefoxImporter::standardPath() const
QString FirefoxImporter::getPath(QWidget* parent)
{
m_path = QFileDialog::getOpenFileName(parent, BookmarksImporter::tr("Choose file..."), standardPath(), "Places (places.sqlite)");
m_path = QFileDialog::getOpenFileName(parent, BookmarksImporter::tr("Choose file..."), standardPath(), QStringLiteral("Places (places.sqlite)"));
return m_path;
}
@ -64,7 +64,7 @@ bool FirefoxImporter::prepareImport()
QSqlDatabase::removeDatabase(CONNECTION);
// Create new connection
QSqlDatabase db = QSqlDatabase::addDatabase("QSQLITE", CONNECTION);
QSqlDatabase db = QSqlDatabase::addDatabase(QStringLiteral("QSQLITE"), CONNECTION);
if (!QFile::exists(m_path)) {
setError(BookmarksImportDialog::tr("File does not exist."));
@ -86,10 +86,10 @@ BookmarkItem* FirefoxImporter::importBookmarks()
QList<Item> items;
BookmarkItem* root = new BookmarkItem(BookmarkItem::Folder);
root->setTitle("Firefox Import");
root->setTitle(QStringLiteral("Firefox Import"));
QSqlQuery query(QSqlDatabase::database(CONNECTION));
query.prepare("SELECT id, parent, type, title, fk FROM moz_bookmarks WHERE fk NOT NULL OR type = 3");
query.prepare(QStringLiteral("SELECT id, parent, type, title, fk FROM moz_bookmarks WHERE fk NOT NULL OR type = 3"));
query.exec();
while (query.next()) {
@ -105,7 +105,7 @@ BookmarkItem* FirefoxImporter::importBookmarks()
}
QSqlQuery query(QSqlDatabase::database(CONNECTION));
query.prepare("SELECT url FROM moz_places WHERE id=?");
query.prepare(QStringLiteral("SELECT url FROM moz_places WHERE id=?"));
query.addBindValue(fk);
query.exec();

View File

@ -35,7 +35,7 @@ QString HtmlImporter::description() const
QString HtmlImporter::standardPath() const
{
return QString(".htm, .html");
return QStringLiteral(".htm, .html");
}
QString HtmlImporter::getPath(QWidget* parent)
@ -95,7 +95,7 @@ BookmarkItem* HtmlImporter::importBookmarks()
int start = bookmarks.indexOf(QLatin1String("<dl><p>"));
BookmarkItem* root = new BookmarkItem(BookmarkItem::Folder);
root->setTitle("HTML Import");
root->setTitle(QStringLiteral("HTML Import"));
QList<BookmarkItem*> folders;
folders.append(root);

View File

@ -59,7 +59,7 @@ bool IeImporter::prepareImport()
BookmarkItem* IeImporter::importBookmarks()
{
BookmarkItem* root = new BookmarkItem(BookmarkItem::Folder);
root->setTitle("Internet Explorer Import");
root->setTitle(QStringLiteral("Internet Explorer Import"));
readDir(QDir(m_path), root);
return root;
@ -78,7 +78,7 @@ void IeImporter::readDir(const QDir &dir, BookmarkItem *parent)
}
else if (file.isFile()) {
QSettings urlFile(file.absoluteFilePath(), QSettings::IniFormat);
const QUrl url = urlFile.value("InternetShortcut/URL").toUrl();
const QUrl url = urlFile.value(QStringLiteral("InternetShortcut/URL")).toUrl();
BookmarkItem* item = new BookmarkItem(BookmarkItem::Url, parent);
item->setTitle(file.baseName());

View File

@ -46,7 +46,7 @@ QString OperaImporter::standardPath() const
QString OperaImporter::getPath(QWidget* parent)
{
m_path = QFileDialog::getOpenFileName(parent, BookmarksImporter::tr("Choose file..."), standardPath(), "Bookmarks (*.adr)");
m_path = QFileDialog::getOpenFileName(parent, BookmarksImporter::tr("Choose file..."), standardPath(), QStringLiteral("Bookmarks (*.adr)"));
return m_path;
}

View File

@ -41,18 +41,18 @@ BookmarksManager::BookmarksManager(BrowserWindow* window, QWidget* parent)
ui->setupUi(this);
ui->tree->setViewType(BookmarksTreeView::BookmarksManagerViewType);
connect(ui->tree, SIGNAL(bookmarkActivated(BookmarkItem*)), this, SLOT(bookmarkActivated(BookmarkItem*)));
connect(ui->tree, SIGNAL(bookmarkCtrlActivated(BookmarkItem*)), this, SLOT(bookmarkCtrlActivated(BookmarkItem*)));
connect(ui->tree, SIGNAL(bookmarkShiftActivated(BookmarkItem*)), this, SLOT(bookmarkShiftActivated(BookmarkItem*)));
connect(ui->tree, &BookmarksTreeView::bookmarkActivated, this, &BookmarksManager::bookmarkActivated);
connect(ui->tree, &BookmarksTreeView::bookmarkCtrlActivated, this, &BookmarksManager::bookmarkCtrlActivated);
connect(ui->tree, &BookmarksTreeView::bookmarkShiftActivated, this, &BookmarksManager::bookmarkShiftActivated);
connect(ui->tree, SIGNAL(bookmarksSelected(QList<BookmarkItem*>)), this, SLOT(bookmarksSelected(QList<BookmarkItem*>)));
connect(ui->tree, SIGNAL(contextMenuRequested(QPoint)), this, SLOT(createContextMenu(QPoint)));
connect(ui->tree, &BookmarksTreeView::contextMenuRequested, this, &BookmarksManager::createContextMenu);
// Box for editing bookmarks
updateEditBox(nullptr);
connect(ui->title, SIGNAL(textEdited(QString)), this, SLOT(bookmarkEdited()));
connect(ui->address, SIGNAL(textEdited(QString)), this, SLOT(bookmarkEdited()));
connect(ui->keyword, SIGNAL(textEdited(QString)), this, SLOT(bookmarkEdited()));
connect(ui->description, SIGNAL(textChanged()), this, SLOT(descriptionEdited()));
connect(ui->title, &QLineEdit::textEdited, this, &BookmarksManager::bookmarkEdited);
connect(ui->address, &QLineEdit::textEdited, this, &BookmarksManager::bookmarkEdited);
connect(ui->keyword, &QLineEdit::textEdited, this, &BookmarksManager::bookmarkEdited);
connect(ui->description, &QPlainTextEdit::textChanged, this, &BookmarksManager::descriptionEdited);
}
BookmarksManager::~BookmarksManager()
@ -108,15 +108,15 @@ void BookmarksManager::createContextMenu(const QPoint &pos)
menu.addSeparator();
menu.addAction(tr("New Bookmark"), this, SLOT(addBookmark()));
menu.addAction(tr("New Folder"), this, SLOT(addFolder()));
menu.addAction(tr("New Separator"), this, SLOT(addSeparator()));
menu.addAction(tr("New Folder"), this, &BookmarksManager::addFolder);
menu.addAction(tr("New Separator"), this, &BookmarksManager::addSeparator);
menu.addSeparator();
QAction* actDelete = menu.addAction(QIcon::fromTheme(QSL("edit-delete")), tr("Delete"));
connect(actNewTab, SIGNAL(triggered()), this, SLOT(openBookmarkInNewTab()));
connect(actNewWindow, SIGNAL(triggered()), this, SLOT(openBookmarkInNewWindow()));
connect(actNewPrivateWindow, SIGNAL(triggered()), this, SLOT(openBookmarkInNewPrivateWindow()));
connect(actDelete, SIGNAL(triggered()), this, SLOT(deleteBookmarks()));
connect(actDelete, &QAction::triggered, this, &BookmarksManager::deleteBookmarks);
bool canBeDeleted = false;
QList<BookmarkItem*> items = ui->tree->selectedBookmarks();
@ -279,7 +279,7 @@ void BookmarksManager::updateEditBox(BookmarkItem* item)
m_blockDescriptionChangedSignal = false;
// Prevent flickering
QTimer::singleShot(10, this, SLOT(enableUpdates()));
QTimer::singleShot(10, this, &BookmarksManager::enableUpdates);
}
bool BookmarksManager::bookmarkEditable(BookmarkItem* item) const

View File

@ -33,9 +33,9 @@ BookmarksMenu::BookmarksMenu(QWidget* parent)
{
init();
connect(mApp->bookmarks(), SIGNAL(bookmarkAdded(BookmarkItem*)), this, SLOT(bookmarksChanged()));
connect(mApp->bookmarks(), SIGNAL(bookmarkRemoved(BookmarkItem*)), this, SLOT(bookmarksChanged()));
connect(mApp->bookmarks(), SIGNAL(bookmarkChanged(BookmarkItem*)), this, SLOT(bookmarksChanged()));
connect(mApp->bookmarks(), &Bookmarks::bookmarkAdded, this, &BookmarksMenu::bookmarksChanged);
connect(mApp->bookmarks(), &Bookmarks::bookmarkRemoved, this, &BookmarksMenu::bookmarksChanged);
connect(mApp->bookmarks(), &Bookmarks::bookmarkChanged, this, &BookmarksMenu::bookmarksChanged);
}
void BookmarksMenu::setMainWindow(BrowserWindow* window)
@ -164,9 +164,9 @@ void BookmarksMenu::init()
{
setTitle(tr("&Bookmarks"));
addAction(tr("Bookmark &This Page"), this, SLOT(bookmarkPage()))->setShortcut(QKeySequence("Ctrl+D"));
addAction(tr("Bookmark &All Tabs"), this, SLOT(bookmarkAllTabs()));
addAction(QIcon::fromTheme("bookmarks-organize"), tr("Organize &Bookmarks"), this, SLOT(showBookmarksManager()))->setShortcut(QKeySequence("Ctrl+Shift+O"));
addAction(tr("Bookmark &This Page"), this, &BookmarksMenu::bookmarkPage)->setShortcut(QKeySequence("Ctrl+D"));
addAction(tr("Bookmark &All Tabs"), this, &BookmarksMenu::bookmarkAllTabs);
addAction(QIcon::fromTheme("bookmarks-organize"), tr("Organize &Bookmarks"), this, &BookmarksMenu::showBookmarksManager)->setShortcut(QKeySequence("Ctrl+Shift+O"));
addSeparator();
connect(this, SIGNAL(aboutToShow()), this, SLOT(aboutToShow()));

View File

@ -36,7 +36,7 @@ BookmarksModel::BookmarksModel(BookmarkItem* root, Bookmarks* bookmarks, QObject
, m_bookmarks(bookmarks)
{
if (m_bookmarks) {
connect(m_bookmarks, SIGNAL(bookmarkChanged(BookmarkItem*)), this, SLOT(bookmarkChanged(BookmarkItem*)));
connect(m_bookmarks, &Bookmarks::bookmarkChanged, this, &BookmarksModel::bookmarkChanged);
}
#ifdef BOOKMARKSMODEL_DEBUG
@ -321,7 +321,7 @@ BookmarksFilterModel::BookmarksFilterModel(QAbstractItemModel* parent)
m_filterTimer->setSingleShot(true);
m_filterTimer->setInterval(300);
connect(m_filterTimer, SIGNAL(timeout()), this, SLOT(startFiltering()));
connect(m_filterTimer, &QTimer::timeout, this, &BookmarksFilterModel::startFiltering);
}
void BookmarksFilterModel::setFilterFixedString(const QString &pattern)

View File

@ -51,14 +51,14 @@ BookmarksToolbar::BookmarksToolbar(BrowserWindow* window, QWidget* parent)
m_updateTimer = new QTimer(this);
m_updateTimer->setInterval(300);
m_updateTimer->setSingleShot(true);
connect(m_updateTimer, SIGNAL(timeout()), this, SLOT(refresh()));
connect(m_updateTimer, &QTimer::timeout, this, &BookmarksToolbar::refresh);
connect(m_bookmarks, SIGNAL(bookmarkAdded(BookmarkItem*)), this, SLOT(bookmarksChanged()));
connect(m_bookmarks, SIGNAL(bookmarkRemoved(BookmarkItem*)), this, SLOT(bookmarksChanged()));
connect(m_bookmarks, SIGNAL(bookmarkChanged(BookmarkItem*)), this, SLOT(bookmarksChanged()));
connect(m_bookmarks, SIGNAL(showOnlyIconsInToolbarChanged(bool)), this, SLOT(showOnlyIconsChanged(bool)));
connect(m_bookmarks, SIGNAL(showOnlyTextInToolbarChanged(bool)), this, SLOT(showOnlyTextChanged(bool)));
connect(this, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(contextMenuRequested(QPoint)));
connect(m_bookmarks, &Bookmarks::bookmarkAdded, this, &BookmarksToolbar::bookmarksChanged);
connect(m_bookmarks, &Bookmarks::bookmarkRemoved, this, &BookmarksToolbar::bookmarksChanged);
connect(m_bookmarks, &Bookmarks::bookmarkChanged, this, &BookmarksToolbar::bookmarksChanged);
connect(m_bookmarks, &Bookmarks::showOnlyIconsInToolbarChanged, this, &BookmarksToolbar::showOnlyIconsChanged);
connect(m_bookmarks, &Bookmarks::showOnlyTextInToolbarChanged, this, &BookmarksToolbar::showOnlyTextChanged);
connect(this, &QWidget::customContextMenuRequested, this, &BookmarksToolbar::contextMenuRequested);
refresh();
}
@ -79,17 +79,17 @@ void BookmarksToolbar::contextMenuRequested(const QPoint &pos)
m_actShowOnlyIcons = menu.addAction(tr("Show Only Icons"));
m_actShowOnlyIcons->setCheckable(true);
m_actShowOnlyIcons->setChecked(m_bookmarks->showOnlyIconsInToolbar());
connect(m_actShowOnlyIcons, SIGNAL(toggled(bool)), m_bookmarks, SLOT(setShowOnlyIconsInToolbar(bool)));
connect(m_actShowOnlyIcons, &QAction::toggled, m_bookmarks, &Bookmarks::setShowOnlyIconsInToolbar);
m_actShowOnlyText = menu.addAction(tr("Show Only Text"));
m_actShowOnlyText->setCheckable(true);
m_actShowOnlyText->setChecked(m_bookmarks->showOnlyTextInToolbar());
connect(m_actShowOnlyText, SIGNAL(toggled(bool)), m_bookmarks, SLOT(setShowOnlyTextInToolbar(bool)));
connect(m_actShowOnlyText, &QAction::toggled, m_bookmarks, &Bookmarks::setShowOnlyTextInToolbar);
connect(actNewTab, SIGNAL(triggered()), this, SLOT(openBookmarkInNewTab()));
connect(actNewWindow, SIGNAL(triggered()), this, SLOT(openBookmarkInNewWindow()));
connect(actNewPrivateWindow, SIGNAL(triggered()), this, SLOT(openBookmarkInNewPrivateWindow()));
connect(actEdit, SIGNAL(triggered()), this, SLOT(editBookmark()));
connect(actDelete, SIGNAL(triggered()), this, SLOT(deleteBookmark()));
connect(actNewTab, &QAction::triggered, this, &BookmarksToolbar::openBookmarkInNewTab);
connect(actNewWindow, &QAction::triggered, this, &BookmarksToolbar::openBookmarkInNewWindow);
connect(actNewPrivateWindow, &QAction::triggered, this, &BookmarksToolbar::openBookmarkInNewPrivateWindow);
connect(actEdit, &QAction::triggered, this, &BookmarksToolbar::editBookmark);
connect(actDelete, &QAction::triggered, this, &BookmarksToolbar::deleteBookmark);
actEdit->setEnabled(m_clickedBookmark && m_bookmarks->canBeModified(m_clickedBookmark));
actDelete->setEnabled(m_clickedBookmark && m_bookmarks->canBeModified(m_clickedBookmark));

View File

@ -75,7 +75,7 @@ void BookmarksFoldersMenu::createMenu(QMenu* menu, BookmarkItem* parent)
{
QAction* act = menu->addAction(tr("Choose %1").arg(parent->title()));
act->setData(QVariant::fromValue<void*>(static_cast<void*>(parent)));
connect(act, SIGNAL(triggered()), this, SLOT(folderChoosed()));
connect(act, &QAction::triggered, this, &BookmarksFoldersMenu::folderChoosed);
menu->addSeparator();
@ -96,7 +96,7 @@ BookmarksFoldersButton::BookmarksFoldersButton(QWidget* parent, BookmarkItem* fo
{
init();
connect(m_menu, SIGNAL(folderSelected(BookmarkItem*)), this, SLOT(setSelectedFolder(BookmarkItem*)));
connect(m_menu, &BookmarksFoldersMenu::folderSelected, this, &BookmarksFoldersButton::setSelectedFolder);
}
BookmarkItem* BookmarksFoldersButton::selectedFolder() const
@ -141,8 +141,8 @@ bool BookmarksTools::addBookmarkDialog(QWidget* parent, const QUrl &url, const Q
QDialogButtonBox* box = new QDialogButtonBox(dialog);
box->addButton(QDialogButtonBox::Ok);
box->addButton(QDialogButtonBox::Cancel);
QObject::connect(box, SIGNAL(rejected()), dialog, SLOT(reject()));
QObject::connect(box, SIGNAL(accepted()), dialog, SLOT(accept()));
QObject::connect(box, &QDialogButtonBox::rejected, dialog, &QDialog::reject);
QObject::connect(box, &QDialogButtonBox::accepted, dialog, &QDialog::accept);
layout->addWidget(label);
layout->addWidget(edit);
@ -186,8 +186,8 @@ bool BookmarksTools::bookmarkAllTabsDialog(QWidget* parent, TabWidget* tabWidget
QDialogButtonBox* box = new QDialogButtonBox(dialog);
box->addButton(QDialogButtonBox::Ok);
box->addButton(QDialogButtonBox::Cancel);
QObject::connect(box, SIGNAL(rejected()), dialog, SLOT(reject()));
QObject::connect(box, SIGNAL(accepted()), dialog, SLOT(accept()));
QObject::connect(box, &QDialogButtonBox::rejected, dialog, &QDialog::reject);
QObject::connect(box, &QDialogButtonBox::accepted, dialog, &QDialog::accept);
layout->addWidget(label);
layout->addWidget(folderButton);

View File

@ -123,20 +123,20 @@ void BookmarksWidget::init()
Q_ASSERT(m_bookmark->parent());
ui->folderButton->setSelectedFolder(m_bookmark->parent());
connect(ui->folderButton, SIGNAL(selectedFolderChanged(BookmarkItem*)), SLOT(bookmarkEdited()));
connect(ui->folderButton, &BookmarksFoldersButton::selectedFolderChanged, this, &BookmarksWidget::bookmarkEdited);
}
connect(ui->speeddialButton, SIGNAL(clicked()), this, SLOT(toggleSpeedDial()));
connect(ui->bookmarksButton, SIGNAL(clicked()), this, SLOT(toggleBookmark()));
connect(ui->speeddialButton, &QAbstractButton::clicked, this, &BookmarksWidget::toggleSpeedDial);
connect(ui->bookmarksButton, &QAbstractButton::clicked, this, &BookmarksWidget::toggleBookmark);
}
void BookmarksWidget::closePopup()
{
// Prevent clicking again on buttons while popup is being closed
disconnect(ui->speeddialButton, SIGNAL(clicked()), this, SLOT(toggleSpeedDial()));
disconnect(ui->bookmarksButton, SIGNAL(clicked()), this, SLOT(toggleBookmark()));
disconnect(ui->speeddialButton, &QAbstractButton::clicked, this, &BookmarksWidget::toggleSpeedDial);
disconnect(ui->bookmarksButton, &QAbstractButton::clicked, this, &BookmarksWidget::toggleBookmark);
QTimer::singleShot(HIDE_DELAY, this, SLOT(close()));
QTimer::singleShot(HIDE_DELAY, this, &QWidget::close);
}

View File

@ -50,19 +50,19 @@ CookieManager::CookieManager(QWidget *parent)
}
// Stored Cookies
connect(ui->cookieTree, SIGNAL(currentItemChanged(QTreeWidgetItem*,QTreeWidgetItem*)), this, SLOT(currentItemChanged(QTreeWidgetItem*,QTreeWidgetItem*)));
connect(ui->removeAll, SIGNAL(clicked()), this, SLOT(removeAll()));
connect(ui->removeOne, SIGNAL(clicked()), this, SLOT(remove()));
connect(ui->close, SIGNAL(clicked(QAbstractButton*)), this, SLOT(close()));
connect(ui->close2, SIGNAL(clicked(QAbstractButton*)), this, SLOT(close()));
connect(ui->close3, SIGNAL(clicked(QAbstractButton*)), this, SLOT(close()));
connect(ui->search, SIGNAL(textChanged(QString)), this, SLOT(filterString(QString)));
connect(ui->cookieTree, &QTreeWidget::currentItemChanged, this, &CookieManager::currentItemChanged);
connect(ui->removeAll, &QAbstractButton::clicked, this, &CookieManager::removeAll);
connect(ui->removeOne, &QAbstractButton::clicked, this, &CookieManager::remove);
connect(ui->close, &QDialogButtonBox::clicked, this, &QWidget::close);
connect(ui->close2, &QDialogButtonBox::clicked, this, &QWidget::close);
connect(ui->close3, &QDialogButtonBox::clicked, this, &QWidget::close);
connect(ui->search, &QLineEdit::textChanged, this, &CookieManager::filterString);
// Cookie Filtering
connect(ui->whiteAdd, SIGNAL(clicked()), this, SLOT(addWhitelist()));
connect(ui->whiteRemove, SIGNAL(clicked()), this, SLOT(removeWhitelist()));
connect(ui->whiteAdd, &QAbstractButton::clicked, this, &CookieManager::addWhitelist);
connect(ui->whiteRemove, &QAbstractButton::clicked, this, &CookieManager::removeWhitelist);
connect(ui->blackAdd, SIGNAL(clicked()), this, SLOT(addBlacklist()));
connect(ui->blackRemove, SIGNAL(clicked()), this, SLOT(removeBlacklist()));
connect(ui->blackRemove, &QAbstractButton::clicked, this, &CookieManager::removeBlacklist);
// Cookie Settings
Settings settings;
@ -89,9 +89,9 @@ CookieManager::CookieManager(QWidget *parent)
ui->blackList->setSortingEnabled(true);
QShortcut* removeShortcut = new QShortcut(QKeySequence("Del"), this);
connect(removeShortcut, SIGNAL(activated()), this, SLOT(deletePressed()));
connect(removeShortcut, &QShortcut::activated, this, &CookieManager::deletePressed);
connect(ui->search, SIGNAL(textChanged(QString)), this, SLOT(filterString(QString)));
connect(ui->search, &QLineEdit::textChanged, this, &CookieManager::filterString);
connect(mApp->cookieJar(), &CookieJar::cookieAdded, this, &CookieManager::addCookie);
connect(mApp->cookieJar(), &CookieJar::cookieRemoved, this, &CookieManager::removeCookie);

View File

@ -72,8 +72,8 @@ DownloadItem::DownloadItem(QListWidgetItem *item, QWebEngineDownloadItem* downlo
setContextMenuPolicy(Qt::CustomContextMenu);
connect(this, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(customContextMenuRequested(QPoint)));
connect(ui->button, SIGNAL(clicked(QPoint)), this, SLOT(stop()));
connect(manager, SIGNAL(resized(QSize)), this, SLOT(parentResized(QSize)));
connect(ui->button, &ClickableLabel::clicked, this, &DownloadItem::stop);
connect(manager, &DownloadManager::resized, this, &DownloadItem::parentResized);
}
void DownloadItem::startDownloading()
@ -279,14 +279,14 @@ void DownloadItem::mouseDoubleClickEvent(QMouseEvent* e)
void DownloadItem::customContextMenuRequested(const QPoint &pos)
{
QMenu menu;
menu.addAction(QIcon::fromTheme("document-open"), tr("Open File"), this, SLOT(openFile()));
menu.addAction(QIcon::fromTheme("document-open"), tr("Open File"), this, &DownloadItem::openFile);
menu.addAction(tr("Open Folder"), this, SLOT(openFolder()));
menu.addAction(tr("Open Folder"), this, &DownloadItem::openFolder);
menu.addSeparator();
menu.addAction(QIcon::fromTheme("edit-copy"), tr("Copy Download Link"), this, SLOT(copyDownloadLink()));
menu.addAction(QIcon::fromTheme("edit-copy"), tr("Copy Download Link"), this, &DownloadItem::copyDownloadLink);
menu.addSeparator();
menu.addAction(QIcon::fromTheme("process-stop"), tr("Cancel downloading"), this, SLOT(stop()))->setEnabled(m_downloading);
menu.addAction(QIcon::fromTheme("list-remove"), tr("Remove From List"), this, SLOT(clear()))->setEnabled(!m_downloading);
menu.addAction(QIcon::fromTheme("process-stop"), tr("Cancel downloading"), this, &DownloadItem::stop)->setEnabled(m_downloading);
menu.addAction(QIcon::fromTheme("list-remove"), tr("Remove From List"), this, &DownloadItem::clear)->setEnabled(!m_downloading);
if (m_downloading || ui->downloadInfo->text().startsWith(tr("Cancelled")) || ui->downloadInfo->text().startsWith(tr("Error"))) {
menu.actions().at(0)->setEnabled(false);

View File

@ -65,10 +65,10 @@ DownloadManager::DownloadManager(QWidget* parent)
ui->clearButton->setIcon(QIcon::fromTheme("edit-clear"));
QzTools::centerWidgetOnScreen(this);
connect(ui->clearButton, SIGNAL(clicked()), this, SLOT(clearList()));
connect(ui->clearButton, &QAbstractButton::clicked, this, &DownloadManager::clearList);
QShortcut* clearShortcut = new QShortcut(QKeySequence("CTRL+L"), this);
connect(clearShortcut, SIGNAL(activated()), this, SLOT(clearList()));
connect(clearShortcut, &QShortcut::activated, this, &DownloadManager::clearList);
loadSettings();
@ -400,8 +400,8 @@ void DownloadManager::download(QWebEngineDownloadItem *downloadItem)
DownloadItem* downItem = new DownloadItem(listItem, downloadItem, QFileInfo(downloadPath).absolutePath(), QFileInfo(downloadPath).fileName(), openFile, this);
downItem->setDownTimer(downloadTimer);
downItem->startDownloading();
connect(downItem, SIGNAL(deleteItem(DownloadItem*)), this, SLOT(deleteItem(DownloadItem*)));
connect(downItem, SIGNAL(downloadFinished(bool)), this, SLOT(downloadFinished(bool)));
connect(downItem, &DownloadItem::deleteItem, this, &DownloadManager::deleteItem);
connect(downItem, &DownloadItem::downloadFinished, this, &DownloadManager::downloadFinished);
ui->list->setItemWidget(listItem, downItem);
listItem->setSizeHint(downItem->sizeHint());
downItem->show();

View File

@ -50,8 +50,8 @@ DownloadOptionsDialog::DownloadOptionsDialog(const QString &fileName, QWebEngine
ui->buttonBox->setFocus();
connect(ui->copyDownloadLink, SIGNAL(clicked(QPoint)), this, SLOT(copyDownloadLink()));
connect(this, SIGNAL(finished(int)), this, SLOT(emitDialogFinished(int)));
connect(ui->copyDownloadLink, &ClickableLabel::clicked, this, &DownloadOptionsDialog::copyDownloadLink);
connect(this, &QDialog::finished, this, &DownloadOptionsDialog::emitDialogFinished);
}
void DownloadOptionsDialog::showExternalManagerOption(bool show)

View File

@ -38,13 +38,13 @@ HistoryManager::HistoryManager(BrowserWindow* window, QWidget* parent)
ui->setupUi(this);
ui->historyTree->setViewType(HistoryTreeView::HistoryManagerViewType);
connect(ui->historyTree, SIGNAL(urlActivated(QUrl)), this, SLOT(urlActivated(QUrl)));
connect(ui->historyTree, SIGNAL(urlCtrlActivated(QUrl)), this, SLOT(urlCtrlActivated(QUrl)));
connect(ui->historyTree, SIGNAL(urlShiftActivated(QUrl)), this, SLOT(urlShiftActivated(QUrl)));
connect(ui->historyTree, SIGNAL(contextMenuRequested(QPoint)), this, SLOT(createContextMenu(QPoint)));
connect(ui->historyTree, &HistoryTreeView::urlActivated, this, &HistoryManager::urlActivated);
connect(ui->historyTree, &HistoryTreeView::urlCtrlActivated, this, &HistoryManager::urlCtrlActivated);
connect(ui->historyTree, &HistoryTreeView::urlShiftActivated, this, &HistoryManager::urlShiftActivated);
connect(ui->historyTree, &HistoryTreeView::contextMenuRequested, this, &HistoryManager::createContextMenu);
connect(ui->deleteB, SIGNAL(clicked()), ui->historyTree, SLOT(removeSelectedItems()));
connect(ui->clearAll, SIGNAL(clicked()), this, SLOT(clearHistory()));
connect(ui->deleteB, &QAbstractButton::clicked, ui->historyTree, &HistoryTreeView::removeSelectedItems);
connect(ui->clearAll, &QAbstractButton::clicked, this, &HistoryManager::clearHistory);
ui->historyTree->setFocus();
}
@ -147,8 +147,8 @@ void HistoryManager::createContextMenu(const QPoint &pos)
QAction* actNewPrivateWindow = menu.addAction(IconProvider::privateBrowsingIcon(), tr("Open in new private window"));
menu.addSeparator();
QAction* actCopyUrl = menu.addAction(tr("Copy url"), this, SLOT(copyUrl()));
QAction* actCopyTitle = menu.addAction(tr("Copy title"), this, SLOT(copyTitle()));
QAction* actCopyUrl = menu.addAction(tr("Copy url"), this, &HistoryManager::copyUrl);
QAction* actCopyTitle = menu.addAction(tr("Copy title"), this, &HistoryManager::copyTitle);
menu.addSeparator();
QAction* actDelete = menu.addAction(QIcon::fromTheme(QSL("edit-delete")), tr("Delete"));
@ -156,7 +156,7 @@ void HistoryManager::createContextMenu(const QPoint &pos)
connect(actNewTab, SIGNAL(triggered()), this, SLOT(openUrlInNewTab()));
connect(actNewWindow, SIGNAL(triggered()), this, SLOT(openUrlInNewWindow()));
connect(actNewPrivateWindow, SIGNAL(triggered()), this, SLOT(openUrlInNewPrivateWindow()));
connect(actDelete, SIGNAL(triggered()), ui->historyTree, SLOT(removeSelectedItems()));
connect(actDelete, &QAction::triggered, ui->historyTree, &HistoryTreeView::removeSelectedItems);
if (ui->historyTree->selectedUrl().isEmpty()) {
actNewTab->setDisabled(true);

View File

@ -101,9 +101,9 @@ void HistoryMenu::aboutToShow()
Action* act = new Action(title);
act->setData(url);
act->setIcon(IconProvider::iconForUrl(url));
connect(act, SIGNAL(triggered()), this, SLOT(historyEntryActivated()));
connect(act, SIGNAL(ctrlTriggered()), this, SLOT(historyEntryCtrlActivated()));
connect(act, SIGNAL(shiftTriggered()), this, SLOT(historyEntryShiftActivated()));
connect(act, &QAction::triggered, this, &HistoryMenu::historyEntryActivated);
connect(act, &Action::ctrlTriggered, this, &HistoryMenu::historyEntryCtrlActivated);
connect(act, &Action::shiftTriggered, this, &HistoryMenu::historyEntryShiftActivated);
addAction(act);
}
}
@ -125,9 +125,9 @@ void HistoryMenu::aboutToShowMostVisited()
Action* act = new Action(QzTools::truncatedText(entry.title, 40));
act->setData(entry.url);
act->setIcon(IconProvider::iconForUrl(entry.url));
connect(act, SIGNAL(triggered()), this, SLOT(historyEntryActivated()));
connect(act, SIGNAL(ctrlTriggered()), this, SLOT(historyEntryCtrlActivated()));
connect(act, SIGNAL(shiftTriggered()), this, SLOT(historyEntryShiftActivated()));
connect(act, &QAction::triggered, this, &HistoryMenu::historyEntryActivated);
connect(act, &Action::ctrlTriggered, this, &HistoryMenu::historyEntryCtrlActivated);
connect(act, &Action::shiftTriggered, this, &HistoryMenu::historyEntryShiftActivated);
m_menuMostVisited->addAction(act);
}
@ -158,8 +158,8 @@ void HistoryMenu::aboutToShowClosedTabs()
}
else {
m_menuClosedTabs->addSeparator();
m_menuClosedTabs->addAction(tr("Restore All Closed Tabs"), tabWidget, SLOT(restoreAllClosedTabs()));
m_menuClosedTabs->addAction(QIcon::fromTheme(QSL("edit-clear")), tr("Clear list"), tabWidget, SLOT(clearClosedTabsList()));
m_menuClosedTabs->addAction(tr("Restore All Closed Tabs"), tabWidget, &TabWidget::restoreAllClosedTabs);
m_menuClosedTabs->addAction(QIcon::fromTheme(QSL("edit-clear")), tr("Clear list"), tabWidget, &TabWidget::clearClosedTabsList);
}
}
@ -173,7 +173,7 @@ void HistoryMenu::aboutToShowClosedWindows()
for (int i = 0; i < closedWindows.count(); ++i) {
const ClosedWindowsManager::Window window = closedWindows.at(i);
const QString title = QzTools::truncatedText(window.title, 40);
QAction *act = m_menuClosedWindows->addAction(window.icon, title, manager, SLOT(restoreClosedWindow()));
QAction *act = m_menuClosedWindows->addAction(window.icon, title, manager, &ClosedWindowsManager::restoreClosedWindow);
if (i == 0) {
act->setShortcut(QKeySequence(QSL("Ctrl+Shift+N")));
act->setShortcutContext(Qt::WidgetShortcut);
@ -186,8 +186,8 @@ void HistoryMenu::aboutToShowClosedWindows()
m_menuClosedWindows->addAction(tr("Empty"))->setEnabled(false);
} else {
m_menuClosedWindows->addSeparator();
m_menuClosedWindows->addAction(tr("Restore All Closed Windows"), manager, SLOT(restoreAllClosedWindows()));
m_menuClosedWindows->addAction(QIcon::fromTheme(QSL("edit-clear")), tr("Clear list"), manager, SLOT(clearClosedWindows()));
m_menuClosedWindows->addAction(tr("Restore All Closed Windows"), manager, &ClosedWindowsManager::restoreAllClosedWindows);
m_menuClosedWindows->addAction(QIcon::fromTheme(QSL("edit-clear")), tr("Clear list"), manager, &ClosedWindowsManager::clearClosedWindows);
}
}
@ -235,16 +235,16 @@ void HistoryMenu::init()
{
setTitle(tr("Hi&story"));
QAction* act = addAction(IconProvider::standardIcon(QStyle::SP_ArrowBack), tr("&Back"), this, SLOT(goBack()));
QAction* act = addAction(IconProvider::standardIcon(QStyle::SP_ArrowBack), tr("&Back"), this, &HistoryMenu::goBack);
act->setShortcut(QzTools::actionShortcut(QKeySequence::Back, Qt::ALT + Qt::Key_Left, QKeySequence::Forward, Qt::ALT + Qt::Key_Right));
act = addAction(IconProvider::standardIcon(QStyle::SP_ArrowForward), tr("&Forward"), this, SLOT(goForward()));
act = addAction(IconProvider::standardIcon(QStyle::SP_ArrowForward), tr("&Forward"), this, &HistoryMenu::goForward);
act->setShortcut(QzTools::actionShortcut(QKeySequence::Forward, Qt::ALT + Qt::Key_Right, QKeySequence::Back, Qt::ALT + Qt::Key_Left));
act = addAction(QIcon::fromTheme("go-home"), tr("&Home"), this, SLOT(goHome()));
act = addAction(QIcon::fromTheme("go-home"), tr("&Home"), this, &HistoryMenu::goHome);
act->setShortcut(QKeySequence(Qt::ALT + Qt::Key_Home));
act = addAction(QIcon::fromTheme("deep-history", QIcon(":/icons/menu/history.svg")), tr("Show &All History"), this, SLOT(showHistoryManager()));
act = addAction(QIcon::fromTheme("deep-history", QIcon(":/icons/menu/history.svg")), tr("Show &All History"), this, &HistoryMenu::showHistoryManager);
act->setShortcut(QKeySequence(Qt::CTRL + Qt::SHIFT + Qt::Key_H));
addSeparator();
@ -253,10 +253,10 @@ void HistoryMenu::init()
connect(this, SIGNAL(aboutToHide()), this, SLOT(aboutToHide()));
m_menuMostVisited = new Menu(tr("Most Visited"), this);
connect(m_menuMostVisited, SIGNAL(aboutToShow()), this, SLOT(aboutToShowMostVisited()));
connect(m_menuMostVisited, &QMenu::aboutToShow, this, &HistoryMenu::aboutToShowMostVisited);
m_menuClosedTabs = new Menu(tr("Closed Tabs"));
connect(m_menuClosedTabs, SIGNAL(aboutToShow()), this, SLOT(aboutToShowClosedTabs()));
connect(m_menuClosedTabs, &QMenu::aboutToShow, this, &HistoryMenu::aboutToShowClosedTabs);
m_menuClosedWindows = new Menu(tr("Closed Windows"));
connect(m_menuClosedWindows, &QMenu::aboutToShow, this, &HistoryMenu::aboutToShowClosedWindows);

View File

@ -42,10 +42,10 @@ HistoryModel::HistoryModel(History* history)
{
init();
connect(m_history, SIGNAL(resetHistory()), this, SLOT(resetHistory()));
connect(m_history, SIGNAL(historyEntryAdded(HistoryEntry)), this, SLOT(historyEntryAdded(HistoryEntry)));
connect(m_history, SIGNAL(historyEntryDeleted(HistoryEntry)), this, SLOT(historyEntryDeleted(HistoryEntry)));
connect(m_history, SIGNAL(historyEntryEdited(HistoryEntry,HistoryEntry)), this, SLOT(historyEntryEdited(HistoryEntry,HistoryEntry)));
connect(m_history, &History::resetHistory, this, &HistoryModel::resetHistory);
connect(m_history, &History::historyEntryAdded, this, &HistoryModel::historyEntryAdded);
connect(m_history, &History::historyEntryDeleted, this, &HistoryModel::historyEntryDeleted);
connect(m_history, &History::historyEntryEdited, this, &HistoryModel::historyEntryEdited);
}
QVariant HistoryModel::headerData(int section, Qt::Orientation orientation, int role) const
@ -522,7 +522,7 @@ HistoryFilterModel::HistoryFilterModel(QAbstractItemModel* parent)
m_filterTimer->setSingleShot(true);
m_filterTimer->setInterval(300);
connect(m_filterTimer, SIGNAL(timeout()), this, SLOT(startFiltering()));
connect(m_filterTimer, &QTimer::timeout, this, &HistoryFilterModel::startFiltering);
}
void HistoryFilterModel::setFilterFixedString(const QString &pattern)

View File

@ -42,8 +42,8 @@ HistoryTreeView::HistoryTreeView(QWidget* parent)
m_header->setSectionHidden(4, true);
setHeader(m_header);
connect(m_filter, SIGNAL(expandAllItems()), this, SLOT(expandAll()));
connect(m_filter, SIGNAL(collapseAllItems()), this, SLOT(collapseAll()));
connect(m_filter, &HistoryFilterModel::expandAllItems, this, &QTreeView::expandAll);
connect(m_filter, &HistoryFilterModel::collapseAllItems, this, &QTreeView::collapseAll);
}
HistoryTreeView::ViewType HistoryTreeView::viewType() const

View File

@ -82,7 +82,7 @@ void LocationCompleter::complete(const QString &string)
emit cancelRefreshJob();
LocationCompleterRefreshJob* job = new LocationCompleterRefreshJob(trimmedStr);
connect(job, SIGNAL(finished()), this, SLOT(refreshJobFinished()));
connect(job, &LocationCompleterRefreshJob::finished, this, &LocationCompleter::refreshJobFinished);
connect(this, SIGNAL(cancelRefreshJob()), job, SLOT(jobCancelled()));
if (qzSettings->searchFromAddressBar && qzSettings->showABSearchSuggestions && trimmedStr.length() >= 2) {
@ -165,14 +165,14 @@ void LocationCompleter::slotPopupClosed()
m_popupClosed = true;
m_oldSuggestions.clear();
disconnect(s_view, SIGNAL(closed()), this, SLOT(slotPopupClosed()));
disconnect(s_view, SIGNAL(indexActivated(QModelIndex)), this, SLOT(indexActivated(QModelIndex)));
disconnect(s_view, SIGNAL(indexCtrlActivated(QModelIndex)), this, SLOT(indexCtrlActivated(QModelIndex)));
disconnect(s_view, SIGNAL(indexShiftActivated(QModelIndex)), this, SLOT(indexShiftActivated(QModelIndex)));
disconnect(s_view, SIGNAL(indexDeleteRequested(QModelIndex)), this, SLOT(indexDeleteRequested(QModelIndex)));
disconnect(s_view, &LocationCompleterView::closed, this, &LocationCompleter::slotPopupClosed);
disconnect(s_view, &LocationCompleterView::indexActivated, this, &LocationCompleter::indexActivated);
disconnect(s_view, &LocationCompleterView::indexCtrlActivated, this, &LocationCompleter::indexCtrlActivated);
disconnect(s_view, &LocationCompleterView::indexShiftActivated, this, &LocationCompleter::indexShiftActivated);
disconnect(s_view, &LocationCompleterView::indexDeleteRequested, this, &LocationCompleter::indexDeleteRequested);
disconnect(s_view, &LocationCompleterView::loadRequested, this, &LocationCompleter::loadRequested);
disconnect(s_view, &LocationCompleterView::searchEnginesDialogRequested, this, &LocationCompleter::openSearchEnginesDialog);
disconnect(s_view->selectionModel(), SIGNAL(currentChanged(QModelIndex,QModelIndex)), this, SLOT(currentChanged(QModelIndex)));
disconnect(s_view->selectionModel(), &QItemSelectionModel::currentChanged, this, &LocationCompleter::currentChanged);
emit popupClosed();
}
@ -404,14 +404,14 @@ void LocationCompleter::showPopup()
s_view->setFocusProxy(m_locationBar);
s_view->setCurrentIndex(QModelIndex());
connect(s_view, SIGNAL(closed()), this, SLOT(slotPopupClosed()));
connect(s_view, SIGNAL(indexActivated(QModelIndex)), this, SLOT(indexActivated(QModelIndex)));
connect(s_view, SIGNAL(indexCtrlActivated(QModelIndex)), this, SLOT(indexCtrlActivated(QModelIndex)));
connect(s_view, SIGNAL(indexShiftActivated(QModelIndex)), this, SLOT(indexShiftActivated(QModelIndex)));
connect(s_view, SIGNAL(indexDeleteRequested(QModelIndex)), this, SLOT(indexDeleteRequested(QModelIndex)));
connect(s_view, &LocationCompleterView::closed, this, &LocationCompleter::slotPopupClosed);
connect(s_view, &LocationCompleterView::indexActivated, this, &LocationCompleter::indexActivated);
connect(s_view, &LocationCompleterView::indexCtrlActivated, this, &LocationCompleter::indexCtrlActivated);
connect(s_view, &LocationCompleterView::indexShiftActivated, this, &LocationCompleter::indexShiftActivated);
connect(s_view, &LocationCompleterView::indexDeleteRequested, this, &LocationCompleter::indexDeleteRequested);
connect(s_view, &LocationCompleterView::loadRequested, this, &LocationCompleter::loadRequested);
connect(s_view, &LocationCompleterView::searchEnginesDialogRequested, this, &LocationCompleter::openSearchEnginesDialog);
connect(s_view->selectionModel(), SIGNAL(currentChanged(QModelIndex,QModelIndex)), this, SLOT(currentChanged(QModelIndex)));
connect(s_view->selectionModel(), &QItemSelectionModel::currentChanged, this, &LocationCompleter::currentChanged);
s_view->createWinId();
s_view->windowHandle()->setTransientParent(m_window->windowHandle());

View File

@ -38,7 +38,7 @@ LocationCompleterRefreshJob::LocationCompleterRefreshJob(const QString &searchSt
, m_jobCancelled(false)
{
m_watcher = new QFutureWatcher<void>(this);
connect(m_watcher, SIGNAL(finished()), this, SLOT(slotFinished()));
connect(m_watcher, &QFutureWatcherBase::finished, this, &LocationCompleterRefreshJob::slotFinished);
QFuture<void> future = QtConcurrent::run(this, &LocationCompleterRefreshJob::runJob);
m_watcher->setFuture(future);

View File

@ -72,9 +72,9 @@ LocationBar::LocationBar(QWidget *parent)
m_completer = new LocationCompleter(this);
m_completer->setLocationBar(this);
connect(m_completer, SIGNAL(showCompletion(QString,bool)), this, SLOT(showCompletion(QString,bool)));
connect(m_completer, SIGNAL(showDomainCompletion(QString)), this, SLOT(showDomainCompletion(QString)));
connect(m_completer, SIGNAL(clearCompletion()), this, SLOT(clearCompletion()));
connect(m_completer, &LocationCompleter::showCompletion, this, &LocationBar::showCompletion);
connect(m_completer, &LocationCompleter::showDomainCompletion, this, &LocationBar::showDomainCompletion);
connect(m_completer, &LocationCompleter::clearCompletion, this, &LocationBar::clearCompletion);
connect(m_completer, &LocationCompleter::loadRequested, this, &LocationBar::loadRequest);
connect(m_completer, &LocationCompleter::popupClosed, this, &LocationBar::updateSiteIcon);
@ -91,14 +91,14 @@ LocationBar::LocationBar(QWidget *parent)
editAction(PasteAndGo)->setText(tr("Paste And &Go"));
editAction(PasteAndGo)->setIcon(QIcon::fromTheme(QSL("edit-paste")));
connect(editAction(PasteAndGo), SIGNAL(triggered()), this, SLOT(pasteAndGo()));
connect(editAction(PasteAndGo), &QAction::triggered, this, &LocationBar::pasteAndGo);
connect(this, SIGNAL(textEdited(QString)), this, SLOT(textEdited(QString)));
connect(m_goIcon, SIGNAL(clicked(QPoint)), this, SLOT(requestLoadUrl()));
connect(down, SIGNAL(clicked(QPoint)), m_completer, SLOT(showMostVisited()));
connect(mApp->searchEnginesManager(), SIGNAL(activeEngineChanged()), this, SLOT(updatePlaceHolderText()));
connect(mApp->searchEnginesManager(), SIGNAL(defaultEngineChanged()), this, SLOT(updatePlaceHolderText()));
connect(mApp, SIGNAL(settingsReloaded()), SLOT(loadSettings()));
connect(m_goIcon, &ClickableLabel::clicked, this, &LocationBar::requestLoadUrl);
connect(down, &ClickableLabel::clicked, m_completer, &LocationCompleter::showMostVisited);
connect(mApp->searchEnginesManager(), &SearchEnginesManager::activeEngineChanged, this, &LocationBar::updatePlaceHolderText);
connect(mApp->searchEnginesManager(), &SearchEnginesManager::defaultEngineChanged, this, &LocationBar::updatePlaceHolderText);
connect(mApp, &MainApplication::settingsReloaded, this, &LocationBar::loadSettings);
loadSettings();
@ -108,7 +108,7 @@ LocationBar::LocationBar(QWidget *parent)
m_goIcon->setVisible(qzSettings->alwaysShowGoIcon);
m_autofillIcon->hide();
QTimer::singleShot(0, this, SLOT(updatePlaceHolderText()));
QTimer::singleShot(0, this, &LocationBar::updatePlaceHolderText);
}
BrowserWindow *LocationBar::browserWindow() const
@ -136,11 +136,11 @@ void LocationBar::setWebView(TabbedWebView* view)
m_siteIcon->setWebView(m_webView);
m_autofillIcon->setWebView(m_webView);
connect(m_webView, SIGNAL(loadStarted()), SLOT(loadStarted()));
connect(m_webView, SIGNAL(loadProgress(int)), SLOT(loadProgress(int)));
connect(m_webView, SIGNAL(loadFinished(bool)), SLOT(loadFinished()));
connect(m_webView, SIGNAL(urlChanged(QUrl)), this, SLOT(showUrl(QUrl)));
connect(m_webView, SIGNAL(privacyChanged(bool)), this, SLOT(setPrivacyState(bool)));
connect(m_webView, &QWebEngineView::loadStarted, this, &LocationBar::loadStarted);
connect(m_webView, &QWebEngineView::loadProgress, this, &LocationBar::loadProgress);
connect(m_webView, &QWebEngineView::loadFinished, this, &LocationBar::loadFinished);
connect(m_webView, &QWebEngineView::urlChanged, this, &LocationBar::showUrl);
connect(m_webView, &WebView::privacyChanged, this, &LocationBar::setPrivacyState);
}
void LocationBar::setText(const QString &text)

View File

@ -120,12 +120,12 @@ NavigationBar::NavigationBar(BrowserWindow* window)
m_menuBack = new Menu(this);
m_menuBack->setCloseOnMiddleClick(true);
m_buttonBack->setMenu(m_menuBack);
connect(m_buttonBack, SIGNAL(aboutToShowMenu()), this, SLOT(aboutToShowHistoryBackMenu()));
connect(m_buttonBack, &ToolButton::aboutToShowMenu, this, &NavigationBar::aboutToShowHistoryBackMenu);
m_menuForward = new Menu(this);
m_menuForward->setCloseOnMiddleClick(true);
m_buttonForward->setMenu(m_menuForward);
connect(m_buttonForward, SIGNAL(aboutToShowMenu()), this, SLOT(aboutToShowHistoryNextMenu()));
connect(m_buttonForward, &ToolButton::aboutToShowMenu, this, &NavigationBar::aboutToShowHistoryNextMenu);
ToolButton *buttonTools = new ToolButton(this);
buttonTools->setObjectName("navigation-button-tools");
@ -169,23 +169,23 @@ NavigationBar::NavigationBar(BrowserWindow* window)
m_exitFullscreen->setVisible(false);
setContextMenuPolicy(Qt::CustomContextMenu);
connect(this, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(contextMenuRequested(QPoint)));
connect(this, &QWidget::customContextMenuRequested, this, &NavigationBar::contextMenuRequested);
connect(m_buttonBack, SIGNAL(clicked()), this, SLOT(goBack()));
connect(m_buttonBack, SIGNAL(middleMouseClicked()), this, SLOT(goBackInNewTab()));
connect(m_buttonBack, SIGNAL(controlClicked()), this, SLOT(goBackInNewTab()));
connect(m_buttonForward, SIGNAL(clicked()), this, SLOT(goForward()));
connect(m_buttonForward, SIGNAL(middleMouseClicked()), this, SLOT(goForwardInNewTab()));
connect(m_buttonForward, SIGNAL(controlClicked()), this, SLOT(goForwardInNewTab()));
connect(m_buttonBack, &QAbstractButton::clicked, this, &NavigationBar::goBack);
connect(m_buttonBack, &ToolButton::middleMouseClicked, this, &NavigationBar::goBackInNewTab);
connect(m_buttonBack, &ToolButton::controlClicked, this, &NavigationBar::goBackInNewTab);
connect(m_buttonForward, &QAbstractButton::clicked, this, &NavigationBar::goForward);
connect(m_buttonForward, &ToolButton::middleMouseClicked, this, &NavigationBar::goForwardInNewTab);
connect(m_buttonForward, &ToolButton::controlClicked, this, &NavigationBar::goForwardInNewTab);
connect(m_reloadStop, SIGNAL(stopClicked()), this, SLOT(stop()));
connect(m_reloadStop, SIGNAL(reloadClicked()), this, SLOT(reload()));
connect(buttonHome, SIGNAL(clicked()), m_window, SLOT(goHome()));
connect(buttonHome, SIGNAL(middleMouseClicked()), m_window, SLOT(goHomeInNewTab()));
connect(buttonHome, SIGNAL(controlClicked()), m_window, SLOT(goHomeInNewTab()));
connect(buttonAddTab, SIGNAL(clicked()), m_window, SLOT(addTab()));
connect(buttonAddTab, SIGNAL(middleMouseClicked()), m_window->tabWidget(), SLOT(addTabFromClipboard()));
connect(m_exitFullscreen, SIGNAL(clicked(bool)), m_window, SLOT(toggleFullScreen()));
connect(m_reloadStop, &ReloadStopButton::stopClicked, this, &NavigationBar::stop);
connect(m_reloadStop, &ReloadStopButton::reloadClicked, this, &NavigationBar::reload);
connect(buttonHome, &QAbstractButton::clicked, m_window, &BrowserWindow::goHome);
connect(buttonHome, &ToolButton::middleMouseClicked, m_window, &BrowserWindow::goHomeInNewTab);
connect(buttonHome, &ToolButton::controlClicked, m_window, &BrowserWindow::goHomeInNewTab);
connect(buttonAddTab, &QAbstractButton::clicked, m_window, &BrowserWindow::addTab);
connect(buttonAddTab, &ToolButton::middleMouseClicked, m_window->tabWidget(), &TabWidget::addTabFromClipboard);
connect(m_exitFullscreen, &QAbstractButton::clicked, m_window, &BrowserWindow::toggleFullScreen);
addWidget(backNextWidget, QSL("button-backforward"), tr("Back and Forward buttons"));
addWidget(m_reloadStop, QSL("button-reloadstop"), tr("Reload button"));
@ -378,7 +378,7 @@ void NavigationBar::aboutToShowHistoryBackMenu()
const QIcon icon = iconForPage(item.url(), IconProvider::standardIcon(QStyle::SP_ArrowBack));
Action* act = new Action(icon, title);
act->setData(i);
connect(act, SIGNAL(triggered()), this, SLOT(loadHistoryIndex()));
connect(act, &QAction::triggered, this, &NavigationBar::loadHistoryIndex);
connect(act, SIGNAL(ctrlTriggered()), this, SLOT(loadHistoryIndexInNewTab()));
m_menuBack->addAction(act);
}
@ -390,7 +390,7 @@ void NavigationBar::aboutToShowHistoryBackMenu()
}
m_menuBack->addSeparator();
m_menuBack->addAction(QIcon::fromTheme(QSL("edit-clear")), tr("Clear history"), this, SLOT(clearHistory()));
m_menuBack->addAction(QIcon::fromTheme(QSL("edit-clear")), tr("Clear history"), this, &NavigationBar::clearHistory);
}
void NavigationBar::aboutToShowHistoryNextMenu()
@ -412,7 +412,7 @@ void NavigationBar::aboutToShowHistoryNextMenu()
const QIcon icon = iconForPage(item.url(), IconProvider::standardIcon(QStyle::SP_ArrowForward));
Action* act = new Action(icon, title);
act->setData(i);
connect(act, SIGNAL(triggered()), this, SLOT(loadHistoryIndex()));
connect(act, &QAction::triggered, this, &NavigationBar::loadHistoryIndex);
connect(act, SIGNAL(ctrlTriggered()), this, SLOT(loadHistoryIndexInNewTab()));
m_menuForward->addAction(act);
}
@ -424,7 +424,7 @@ void NavigationBar::aboutToShowHistoryNextMenu()
}
m_menuForward->addSeparator();
m_menuForward->addAction(QIcon::fromTheme(QSL("edit-clear")), tr("Clear history"), this, SLOT(clearHistory()));
m_menuForward->addAction(QIcon::fromTheme(QSL("edit-clear")), tr("Clear history"), this, &NavigationBar::clearHistory);
}
void NavigationBar::aboutToShowToolsMenu()
@ -447,7 +447,7 @@ void NavigationBar::aboutToShowToolsMenu()
}
m_menuTools->addSeparator();
m_menuTools->addAction(IconProvider::settingsIcon(), tr("Configure Toolbar"), this, SLOT(openConfigurationDialog()));
m_menuTools->addAction(IconProvider::settingsIcon(), tr("Configure Toolbar"), this, &NavigationBar::openConfigurationDialog);
}
void NavigationBar::clearHistory()
@ -461,7 +461,7 @@ void NavigationBar::contextMenuRequested(const QPoint &pos)
QMenu menu;
m_window->createToolbarsMenu(&menu);
menu.addSeparator();
menu.addAction(IconProvider::settingsIcon(), tr("Configure Toolbar"), this, SLOT(openConfigurationDialog()));
menu.addAction(IconProvider::settingsIcon(), tr("Configure Toolbar"), this, &NavigationBar::openConfigurationDialog);
menu.exec(mapToGlobal(pos));
}

View File

@ -32,9 +32,9 @@ ReloadStopButton::ReloadStopButton(QWidget* parent)
m_updateTimer = new QTimer(this);
m_updateTimer->setInterval(50);
m_updateTimer->setSingleShot(true);
connect(m_updateTimer, SIGNAL(timeout()), this, SLOT(updateButton()));
connect(m_updateTimer, &QTimer::timeout, this, &ReloadStopButton::updateButton);
connect(this, SIGNAL(clicked()), this, SLOT(buttonClicked()));
connect(this, &QAbstractButton::clicked, this, &ReloadStopButton::buttonClicked);
updateButton();
}

View File

@ -43,7 +43,7 @@ SiteIcon::SiteIcon(LocationBar *parent)
m_updateTimer = new QTimer(this);
m_updateTimer->setInterval(100);
m_updateTimer->setSingleShot(true);
connect(m_updateTimer, SIGNAL(timeout()), this, SLOT(updateIcon()));
connect(m_updateTimer, &QTimer::timeout, this, &SiteIcon::updateIcon);
}
void SiteIcon::setBrowserWindow(BrowserWindow *window)
@ -173,7 +173,7 @@ bool SiteIcon::showPopup()
SiteInfoWidget* info = new SiteInfoWidget(m_window);
info->showAt(parentWidget());
connect(info, SIGNAL(destroyed()), this, SLOT(popupClosed()));
connect(info, &QObject::destroyed, this, &SiteIcon::popupClosed);
return true;
}

View File

@ -75,14 +75,14 @@ WebSearchBar::WebSearchBar(BrowserWindow* window)
addWidget(m_buttonSearch, LineEdit::RightSide);
connect(m_buttonSearch, SIGNAL(clicked(QPoint)), this, SLOT(search()));
connect(m_buttonSearch, SIGNAL(middleClicked(QPoint)), this, SLOT(searchInNewTab()));
connect(m_boxSearchType, SIGNAL(activeItemChanged(ButtonWithMenu::Item)), this, SLOT(searchChanged(ButtonWithMenu::Item)));
connect(m_buttonSearch, &ClickableLabel::clicked, this, &WebSearchBar::search);
connect(m_buttonSearch, &ClickableLabel::middleClicked, this, &WebSearchBar::searchInNewTab);
connect(m_boxSearchType, &ButtonWithMenu::activeItemChanged, this, &WebSearchBar::searchChanged);
setWidgetSpacing(0);
m_searchManager = mApp->searchEnginesManager();
connect(m_boxSearchType->menu(), SIGNAL(aboutToShow()), this, SLOT(aboutToShowMenu()));
connect(m_boxSearchType->menu(), &QMenu::aboutToShow, this, &WebSearchBar::aboutToShowMenu);
m_completer = new QCompleter(this);
m_completer->setCompletionMode(QCompleter::UnfilteredPopupCompletion);
@ -94,14 +94,14 @@ WebSearchBar::WebSearchBar(BrowserWindow* window)
m_openSearchEngine = new OpenSearchEngine(this);
m_openSearchEngine->setNetworkAccessManager(mApp->networkManager());
connect(m_openSearchEngine, SIGNAL(suggestions(QStringList)), this, SLOT(addSuggestions(QStringList)));
connect(this, SIGNAL(textEdited(QString)), m_openSearchEngine, SLOT(requestSuggestions(QString)));
connect(m_openSearchEngine, &OpenSearchEngine::suggestions, this, &WebSearchBar::addSuggestions);
connect(this, &QLineEdit::textEdited, m_openSearchEngine, &OpenSearchEngine::requestSuggestions);
editAction(PasteAndGo)->setText(tr("Paste And &Search"));
editAction(PasteAndGo)->setIcon(QIcon::fromTheme(QSL("edit-paste")));
connect(editAction(PasteAndGo), SIGNAL(triggered()), this, SLOT(pasteAndGo()));
connect(editAction(PasteAndGo), &QAction::triggered, this, &WebSearchBar::pasteAndGo);
QTimer::singleShot(0, this, SLOT(setupEngines()));
QTimer::singleShot(0, this, &WebSearchBar::setupEngines);
}
void WebSearchBar::aboutToShowMenu()
@ -123,11 +123,11 @@ void WebSearchBar::aboutToShowMenu()
if (title.isEmpty())
title = m_window->weView()->title();
menu->addAction(m_window->weView()->icon(), tr("Add %1 ...").arg(title), this, SLOT(addEngineFromAction()))->setData(url);
menu->addAction(m_window->weView()->icon(), tr("Add %1 ...").arg(title), this, &WebSearchBar::addEngineFromAction)->setData(url);
}
menu->addSeparator();
menu->addAction(IconProvider::settingsIcon(), tr("Manage Search Engines"), this, SLOT(openSearchEnginesDialog()));
menu->addAction(IconProvider::settingsIcon(), tr("Manage Search Engines"), this, &WebSearchBar::openSearchEnginesDialog);
});
}
@ -163,7 +163,7 @@ void WebSearchBar::enableSearchSuggestions(bool enable)
void WebSearchBar::setupEngines()
{
disconnect(m_searchManager, SIGNAL(enginesChanged()), this, SLOT(setupEngines()));
disconnect(m_searchManager, &SearchEnginesManager::enginesChanged, this, &WebSearchBar::setupEngines);
m_reloadingEngines = true;
QString activeEngine = m_searchManager->startingEngineName();
@ -191,7 +191,7 @@ void WebSearchBar::setupEngines()
searchChanged(m_boxSearchType->currentItem());
connect(m_searchManager, SIGNAL(enginesChanged()), this, SLOT(setupEngines()));
connect(m_searchManager, &SearchEnginesManager::enginesChanged, this, &WebSearchBar::setupEngines);
m_reloadingEngines = false;
}
@ -259,12 +259,12 @@ void WebSearchBar::contextMenuEvent(QContextMenuEvent* event)
QAction* act = menu->addAction(tr("Show suggestions"));
act->setCheckable(true);
act->setChecked(qzSettings->showWSBSearchSuggestions);
connect(act, SIGNAL(triggered(bool)), this, SLOT(enableSearchSuggestions(bool)));
connect(act, &QAction::triggered, this, &WebSearchBar::enableSearchSuggestions);
QAction* instantSearch = menu->addAction(tr("Search when engine changed"));
instantSearch->setCheckable(true);
instantSearch->setChecked(qzSettings->searchOnEngineChange);
connect(instantSearch, SIGNAL(triggered(bool)), this, SLOT(instantSearchChanged(bool)));
connect(instantSearch, &QAction::triggered, this, &WebSearchBar::instantSearchChanged);
// Prevent choosing first option with double rightclick
QPoint pos = event->globalPos();

View File

@ -126,8 +126,8 @@ void NetworkManager::authentication(const QUrl &url, QAuthenticator *auth, QWidg
QDialogButtonBox* box = new QDialogButtonBox(dialog);
box->addButton(QDialogButtonBox::Ok);
box->addButton(QDialogButtonBox::Cancel);
connect(box, SIGNAL(rejected()), dialog, SLOT(reject()));
connect(box, SIGNAL(accepted()), dialog, SLOT(accept()));
connect(box, &QDialogButtonBox::rejected, dialog, &QDialog::reject);
connect(box, &QDialogButtonBox::accepted, dialog, &QDialog::accept);
label->setText(tr("A username and password are being requested by %1. "
"The site says: \"%2\"").arg(url.host(), auth->realm().toHtmlEscaped()));
@ -210,8 +210,8 @@ void NetworkManager::proxyAuthentication(const QString &proxyHost, QAuthenticato
QDialogButtonBox* box = new QDialogButtonBox(dialog);
box->addButton(QDialogButtonBox::Ok);
box->addButton(QDialogButtonBox::Cancel);
connect(box, SIGNAL(rejected()), dialog, SLOT(reject()));
connect(box, SIGNAL(accepted()), dialog, SLOT(accept()));
connect(box, &QDialogButtonBox::rejected, dialog, &QDialog::reject);
connect(box, &QDialogButtonBox::accepted, dialog, &QDialog::accept);
label->setText(tr("A username and password are being requested by proxy %1. ").arg(proxyHost));
formLa->addRow(label);

View File

@ -32,7 +32,7 @@ SslErrorDialog::SslErrorDialog(QWidget* parent)
//ui->buttonBox->addButton(tr("Only for this session"), QDialogButtonBox::ApplyRole);
ui->buttonBox->button(QDialogButtonBox::No)->setFocus();
connect(ui->buttonBox, SIGNAL(clicked(QAbstractButton*)), this, SLOT(buttonClicked(QAbstractButton*)));
connect(ui->buttonBox, &QDialogButtonBox::clicked, this, &SslErrorDialog::buttonClicked);
}
SslErrorDialog::~SslErrorDialog()

View File

@ -33,7 +33,7 @@ DesktopNotification::DesktopNotification(bool setPosition)
setWindowFlags(Qt::FramelessWindowHint | Qt::WindowStaysOnTopHint | Qt::X11BypassWindowManagerHint);
m_timer->setSingleShot(true);
connect(m_timer, SIGNAL(timeout()), this, SLOT(close()));
connect(m_timer, &QTimer::timeout, this, &QWidget::close);
if (m_settingPosition) {
setCursor(Qt::OpenHandCursor);

View File

@ -28,7 +28,7 @@ EditSearchEngine::EditSearchEngine(const QString &title, QWidget* parent)
setWindowTitle(title);
ui->setupUi(this);
connect(ui->iconFromFile, SIGNAL(clicked()), this, SLOT(chooseIcon()));
connect(ui->iconFromFile, &QAbstractButton::clicked, this, &EditSearchEngine::chooseIcon);
ui->buttonBox->setFocus();

View File

@ -427,7 +427,7 @@ void OpenSearchEngine::loadImage() const
}
QNetworkReply* reply = m_networkAccessManager->get(QNetworkRequest(QUrl::fromEncoded(m_imageUrl.toUtf8())));
connect(reply, SIGNAL(finished()), this, SLOT(imageObtained()));
connect(reply, &QNetworkReply::finished, this, &OpenSearchEngine::imageObtained);
}
void OpenSearchEngine::imageObtained()
@ -583,7 +583,7 @@ void OpenSearchEngine::requestSuggestions(const QString &searchTerm)
m_suggestionsReply = m_networkAccessManager->post(QNetworkRequest(suggestionsUrl(searchTerm)), data);
}
connect(m_suggestionsReply, SIGNAL(finished()), this, SLOT(suggestionsObtained()));
connect(m_suggestionsReply, &QNetworkReply::finished, this, &OpenSearchEngine::suggestionsObtained);
}
/*!

View File

@ -32,15 +32,15 @@ SearchEnginesDialog::SearchEnginesDialog(QWidget* parent)
ui->setupUi(this);
connect(ui->add, SIGNAL(clicked()), this, SLOT(addEngine()));
connect(ui->remove, SIGNAL(clicked()), this, SLOT(removeEngine()));
connect(ui->edit, SIGNAL(clicked()), this, SLOT(editEngine()));
connect(ui->setAsDefault, SIGNAL(clicked()), this, SLOT(setDefaultEngine()));
connect(ui->defaults, SIGNAL(clicked()), this, SLOT(defaults()));
connect(ui->moveUp, SIGNAL(clicked()), this, SLOT(moveUp()));
connect(ui->moveDown, SIGNAL(clicked()), this, SLOT(moveDown()));
connect(ui->add, &QAbstractButton::clicked, this, &SearchEnginesDialog::addEngine);
connect(ui->remove, &QAbstractButton::clicked, this, &SearchEnginesDialog::removeEngine);
connect(ui->edit, &QAbstractButton::clicked, this, &SearchEnginesDialog::editEngine);
connect(ui->setAsDefault, &QAbstractButton::clicked, this, &SearchEnginesDialog::setDefaultEngine);
connect(ui->defaults, &QAbstractButton::clicked, this, &SearchEnginesDialog::defaults);
connect(ui->moveUp, &QAbstractButton::clicked, this, &SearchEnginesDialog::moveUp);
connect(ui->moveDown, &QAbstractButton::clicked, this, &SearchEnginesDialog::moveDown);
connect(ui->treeWidget, SIGNAL(itemDoubleClicked(QTreeWidgetItem*,int)), this, SLOT(editEngine()));
connect(ui->treeWidget, &QTreeWidget::itemDoubleClicked, this, &SearchEnginesDialog::editEngine);
ui->treeWidget->setItemDelegate(new RemoveItemFocusDelegate(ui->treeWidget));
ui->treeWidget->sortByColumn(-1);

View File

@ -75,7 +75,7 @@ SearchEnginesManager::SearchEnginesManager(QObject* parent)
m_defaultEngineName = settings.value("DefaultEngine", "DuckDuckGo").toString();
settings.endGroup();
connect(this, SIGNAL(enginesChanged()), this, SLOT(scheduleSave()));
connect(this, &SearchEnginesManager::enginesChanged, this, &SearchEnginesManager::scheduleSave);
}
void SearchEnginesManager::loadSettings()
@ -357,7 +357,7 @@ void SearchEnginesManager::addEngine(OpenSearchEngine* engine)
addEngine(en);
connect(engine, SIGNAL(imageChanged()), this, SLOT(engineChangedImage()));
connect(engine, &OpenSearchEngine::imageChanged, this, &SearchEnginesManager::engineChangedImage);
}
void SearchEnginesManager::addEngine(const QUrl &url)
@ -372,7 +372,7 @@ void SearchEnginesManager::addEngine(const QUrl &url)
QNetworkReply* reply = mApp->networkManager()->get(QNetworkRequest(url));
reply->setParent(this);
connect(reply, SIGNAL(finished()), this, SLOT(replyFinished()));
connect(reply, &QNetworkReply::finished, this, &SearchEnginesManager::replyFinished);
}
void SearchEnginesManager::replyFinished()

View File

@ -58,12 +58,12 @@ BrowsingLibrary::BrowsingLibrary(BrowserWindow* window, QWidget* parent)
ui->tabs->setFocus();
QMenu* m = new QMenu(this);
m->addAction(tr("Import Bookmarks..."), this, SLOT(importBookmarks()));
m->addAction(tr("Export Bookmarks..."), this, SLOT(exportBookmarks()));
m->addAction(tr("Import Bookmarks..."), this, &BrowsingLibrary::importBookmarks);
m->addAction(tr("Export Bookmarks..."), this, &BrowsingLibrary::exportBookmarks);
ui->importExport->setMenu(m);
connect(ui->tabs, &FancyTabWidget::CurrentChanged, ui->searchLine, &QLineEdit::clear);
connect(ui->searchLine, SIGNAL(textChanged(QString)), this, SLOT(search()));
connect(ui->searchLine, &QLineEdit::textChanged, this, &BrowsingLibrary::search);
QzTools::setWmClass("Browsing Library", this);
}

View File

@ -47,10 +47,10 @@ ClearPrivateData::ClearPrivateData(QWidget* parent)
ui->setupUi(this);
ui->buttonBox->setFocus();
connect(ui->history, SIGNAL(clicked(bool)), this, SLOT(historyClicked(bool)));
connect(ui->clear, SIGNAL(clicked(bool)), this, SLOT(dialogAccepted()));
connect(ui->optimizeDb, SIGNAL(clicked(bool)), this, SLOT(optimizeDb()));
connect(ui->editCookies, SIGNAL(clicked()), this, SLOT(showCookieManager()));
connect(ui->history, &QAbstractButton::clicked, this, &ClearPrivateData::historyClicked);
connect(ui->clear, &QAbstractButton::clicked, this, &ClearPrivateData::dialogAccepted);
connect(ui->optimizeDb, &QAbstractButton::clicked, this, &ClearPrivateData::optimizeDb);
connect(ui->editCookies, &QAbstractButton::clicked, this, &ClearPrivateData::showCookieManager);
Settings settings;
settings.beginGroup("ClearPrivateData");
@ -153,7 +153,7 @@ void ClearPrivateData::dialogAccepted()
ui->clear->setEnabled(false);
ui->clear->setText(tr("Done"));
QTimer::singleShot(1000, this, SLOT(close()));
QTimer::singleShot(1000, this, &QWidget::close);
}
void ClearPrivateData::optimizeDb()

View File

@ -32,8 +32,8 @@ IconChooser::IconChooser(QWidget* parent)
ui->iconList->setItemDelegate(new IconChooserDelegate(ui->iconList));
connect(ui->chooseFile, SIGNAL(clicked()), this, SLOT(chooseFile()));
connect(ui->siteUrl, SIGNAL(textChanged(QString)), this, SLOT(searchIcon(QString)));
connect(ui->chooseFile, &QAbstractButton::clicked, this, &IconChooser::chooseFile);
connect(ui->siteUrl, &QLineEdit::textChanged, this, &IconChooser::searchIcon);
}
void IconChooser::chooseFile()

View File

@ -37,7 +37,7 @@ LicenseViewer::LicenseViewer(QWidget* parent)
QDialogButtonBox* buttonBox = new QDialogButtonBox(this);
buttonBox->setStandardButtons(QDialogButtonBox::Close);
connect(buttonBox, SIGNAL(rejected()), this, SLOT(close()));
connect(buttonBox, &QDialogButtonBox::rejected, this, &QWidget::close);
QVBoxLayout* l = new QVBoxLayout(this);
l->addWidget(m_textBrowser);

View File

@ -81,7 +81,7 @@ SiteInfoWidget::SiteInfoWidget(BrowserWindow* window, QWidget* parent)
}
}
connect(ui->pushButton, SIGNAL(clicked()), m_window->action(QSL("Tools/SiteInfo")), SLOT(trigger()));
connect(ui->pushButton, &QAbstractButton::clicked, m_window->action(QSL("Tools/SiteInfo")), &QAction::trigger);
}
SiteInfoWidget::~SiteInfoWidget()

View File

@ -120,7 +120,7 @@ TipLabel::TipLabel(QWidget* parent)
m_timer = new QTimer(this);
m_timer->setSingleShot(true);
m_timer->setInterval(500);
connect(m_timer, SIGNAL(timeout()), this, SLOT(hide()));
connect(m_timer, &QTimer::timeout, this, &QWidget::hide);
}
void TipLabel::show(QWidget* widget)

View File

@ -115,7 +115,7 @@ Updater::Updater(BrowserWindow* window, QObject* parent)
: QObject(parent)
, m_window(window)
{
QTimer::singleShot(60 * 1000, this, SLOT(start())); // Start checking after 1 minute
QTimer::singleShot(60 * 1000, this, &Updater::start); // Start checking after 1 minute
}
void Updater::start()
@ -131,7 +131,7 @@ void Updater::startDownloadingUpdateInfo(const QUrl &url)
{
QNetworkReply *reply = mApp->networkManager()->get(QNetworkRequest(QUrl(url)));
connect(reply, SIGNAL(finished()), this, SLOT(downCompleted()));
connect(reply, &QNetworkReply::finished, this, &Updater::downCompleted);
}
void Updater::downCompleted()

View File

@ -40,8 +40,8 @@ SpeedDial::SpeedDial(QObject* parent)
, m_regenerateScript(true)
{
m_autoSaver = new AutoSaver(this);
connect(m_autoSaver, SIGNAL(save()), this, SLOT(saveSettings()));
connect(this, SIGNAL(pagesChanged()), m_autoSaver, SLOT(changeOccurred()));
connect(m_autoSaver, &AutoSaver::save, this, &SpeedDial::saveSettings);
connect(this, &SpeedDial::pagesChanged, m_autoSaver, &AutoSaver::changeOccurred);
}
SpeedDial::~SpeedDial()
@ -261,7 +261,7 @@ void SpeedDial::loadThumbnail(const QString &url, bool loadTitle)
PageThumbnailer* thumbnailer = new PageThumbnailer(this);
thumbnailer->setUrl(QUrl::fromEncoded(url.toUtf8()));
thumbnailer->setLoadTitle(loadTitle);
connect(thumbnailer, SIGNAL(thumbnailCreated(QPixmap)), this, SLOT(thumbnailCreated(QPixmap)));
connect(thumbnailer, &PageThumbnailer::thumbnailCreated, this, &SpeedDial::thumbnailCreated);
thumbnailer->start();
}

View File

@ -97,7 +97,7 @@ void PopupWebView::_contextMenuEvent(QContextMenuEvent *event)
if (WebInspector::isEnabled()) {
m_menu->addSeparator();
m_menu->addAction(tr("Inspect Element"), this, SLOT(inspectElement()));
m_menu->addAction(tr("Inspect Element"), this, &PopupWebView::inspectElement);
}
if (!m_menu->isEmpty()) {

View File

@ -81,10 +81,10 @@ PopupWindow::PopupWindow(PopupWebView* view)
m_menuBar = new QMenuBar(this);
QMenu* menuFile = new QMenu(tr("File"));
menuFile->addAction(QIcon::fromTheme("mail-message-new"), tr("Send Link..."), m_view, SLOT(sendPageByMail()));
menuFile->addAction(QIcon::fromTheme("document-print"), tr("&Print..."), m_view, SLOT(printPage()))->setShortcut(QKeySequence("Ctrl+P"));
menuFile->addAction(QIcon::fromTheme("mail-message-new"), tr("Send Link..."), m_view, &WebView::sendPageByMail);
menuFile->addAction(QIcon::fromTheme("document-print"), tr("&Print..."), m_view, &WebView::printPage)->setShortcut(QKeySequence("Ctrl+P"));
menuFile->addSeparator();
menuFile->addAction(QIcon::fromTheme("window-close"), tr("Close"), this, SLOT(close()))->setShortcut(QKeySequence("Ctrl+W"));
menuFile->addAction(QIcon::fromTheme("window-close"), tr("Close"), this, &QWidget::close)->setShortcut(QKeySequence("Ctrl+W"));
m_menuBar->addMenu(menuFile);
m_menuEdit = new QMenu(tr("Edit"));
@ -96,20 +96,20 @@ PopupWindow::PopupWindow(PopupWebView* view)
m_menuEdit->addAction(m_view->pageAction(QWebEnginePage::Paste));
m_menuEdit->addSeparator();
m_menuEdit->addAction(m_view->pageAction(QWebEnginePage::SelectAll));
m_menuEdit->addAction(QIcon::fromTheme("edit-find"), tr("Find"), this, SLOT(searchOnPage()))->setShortcut(QKeySequence("Ctrl+F"));
m_menuEdit->addAction(QIcon::fromTheme("edit-find"), tr("Find"), this, &PopupWindow::searchOnPage)->setShortcut(QKeySequence("Ctrl+F"));
m_menuBar->addMenu(m_menuEdit);
m_menuView = new QMenu(tr("View"));
m_actionStop = m_menuView->addAction(QIcon::fromTheme(QSL("process-stop")), tr("&Stop"), m_view, SLOT(stop()));
m_actionStop = m_menuView->addAction(QIcon::fromTheme(QSL("process-stop")), tr("&Stop"), m_view, &QWebEngineView::stop);
m_actionStop->setShortcut(QKeySequence("Esc"));
m_actionReload = m_menuView->addAction(QIcon::fromTheme(QSL("view-refresh")), tr("&Reload"), m_view, SLOT(reload()));
m_actionReload = m_menuView->addAction(QIcon::fromTheme(QSL("view-refresh")), tr("&Reload"), m_view, &QWebEngineView::reload);
m_actionReload->setShortcut(QKeySequence("F5"));
m_menuView->addSeparator();
m_menuView->addAction(QIcon::fromTheme("zoom-in"), tr("Zoom &In"), m_view, SLOT(zoomIn()))->setShortcut(QKeySequence("Ctrl++"));
m_menuView->addAction(QIcon::fromTheme("zoom-out"), tr("Zoom &Out"), m_view, SLOT(zoomOut()))->setShortcut(QKeySequence("Ctrl+-"));
m_menuView->addAction(QIcon::fromTheme("zoom-original"), tr("Reset"), m_view, SLOT(zoomReset()))->setShortcut(QKeySequence("Ctrl+0"));
m_menuView->addAction(QIcon::fromTheme("zoom-in"), tr("Zoom &In"), m_view, &WebView::zoomIn)->setShortcut(QKeySequence("Ctrl++"));
m_menuView->addAction(QIcon::fromTheme("zoom-out"), tr("Zoom &Out"), m_view, &WebView::zoomOut)->setShortcut(QKeySequence("Ctrl+-"));
m_menuView->addAction(QIcon::fromTheme("zoom-original"), tr("Reset"), m_view, &WebView::zoomReset)->setShortcut(QKeySequence("Ctrl+0"));
m_menuView->addSeparator();
m_menuView->addAction(QIcon::fromTheme("text-html"), tr("&Page Source"), m_view, SLOT(showSource()))->setShortcut(QKeySequence("Ctrl+U"));
m_menuView->addAction(QIcon::fromTheme("text-html"), tr("&Page Source"), m_view, &WebView::showSource)->setShortcut(QKeySequence("Ctrl+U"));
m_menuBar->addMenu(m_menuView);
// Make shortcuts available even with hidden menubar

View File

@ -105,10 +105,10 @@ AcceptLanguage::AcceptLanguage(QWidget* parent)
ui->listWidget->addItem(label);
}
connect(ui->add, SIGNAL(clicked()), this, SLOT(addLanguage()));
connect(ui->remove, SIGNAL(clicked()), this, SLOT(removeLanguage()));
connect(ui->up, SIGNAL(clicked()), this, SLOT(upLanguage()));
connect(ui->down, SIGNAL(clicked()), this, SLOT(downLanguage()));
connect(ui->add, &QAbstractButton::clicked, this, &AcceptLanguage::addLanguage);
connect(ui->remove, &QAbstractButton::clicked, this, &AcceptLanguage::removeLanguage);
connect(ui->up, &QAbstractButton::clicked, this, &AcceptLanguage::upLanguage);
connect(ui->down, &QAbstractButton::clicked, this, &AcceptLanguage::downLanguage);
}
QStringList AcceptLanguage::expand(const QLocale::Language &language)
@ -150,7 +150,7 @@ void AcceptLanguage::addLanguage()
acceptLangUi.listWidget->addItems(allLanguages);
connect(acceptLangUi.listWidget, SIGNAL(itemDoubleClicked(QListWidgetItem*)), &dialog, SLOT(accept()));
connect(acceptLangUi.listWidget, &QListWidget::itemDoubleClicked, &dialog, &QDialog::accept);
if (dialog.exec() == QDialog::Rejected) {
return;

View File

@ -48,24 +48,24 @@ AutoFillManager::AutoFillManager(QWidget* parent)
ui->treeExcept->setLayoutDirection(Qt::LeftToRight);
}
connect(ui->removePass, SIGNAL(clicked()), this, SLOT(removePass()));
connect(ui->removeAllPass, SIGNAL(clicked()), this, SLOT(removeAllPass()));
connect(ui->editPass, SIGNAL(clicked()), this, SLOT(editPass()));
connect(ui->showPasswords, SIGNAL(clicked()), this, SLOT(showPasswords()));
connect(ui->search, SIGNAL(textChanged(QString)), ui->treePass, SLOT(filterString(QString)));
connect(ui->changeBackend, SIGNAL(clicked()), this, SLOT(changePasswordBackend()));
connect(ui->backendOptions, SIGNAL(clicked()), this, SLOT(showBackendOptions()));
connect(m_passwordManager, SIGNAL(passwordBackendChanged()), this, SLOT(currentPasswordBackendChanged()));
connect(ui->removePass, &QAbstractButton::clicked, this, &AutoFillManager::removePass);
connect(ui->removeAllPass, &QAbstractButton::clicked, this, &AutoFillManager::removeAllPass);
connect(ui->editPass, &QAbstractButton::clicked, this, &AutoFillManager::editPass);
connect(ui->showPasswords, &QAbstractButton::clicked, this, &AutoFillManager::showPasswords);
connect(ui->search, &QLineEdit::textChanged, ui->treePass, &TreeWidget::filterString);
connect(ui->changeBackend, &QAbstractButton::clicked, this, &AutoFillManager::changePasswordBackend);
connect(ui->backendOptions, &QAbstractButton::clicked, this, &AutoFillManager::showBackendOptions);
connect(m_passwordManager, &PasswordManager::passwordBackendChanged, this, &AutoFillManager::currentPasswordBackendChanged);
connect(ui->removeExcept, SIGNAL(clicked()), this, SLOT(removeExcept()));
connect(ui->removeAllExcept, SIGNAL(clicked()), this, SLOT(removeAllExcept()));
connect(ui->removeExcept, &QAbstractButton::clicked, this, &AutoFillManager::removeExcept);
connect(ui->removeAllExcept, &QAbstractButton::clicked, this, &AutoFillManager::removeAllExcept);
ui->treePass->setContextMenuPolicy(Qt::CustomContextMenu);
connect(ui->treePass, &TreeWidget::customContextMenuRequested, this, &AutoFillManager::passwordContextMenu);
QMenu* menu = new QMenu(this);
menu->addAction(tr("Import Passwords from File..."), this, SLOT(importPasswords()));
menu->addAction(tr("Export Passwords to File..."), this, SLOT(exportPasswords()));
menu->addAction(tr("Import Passwords from File..."), this, &AutoFillManager::importPasswords);
menu->addAction(tr("Export Passwords to File..."), this, &AutoFillManager::exportPasswords);
ui->importExport->setMenu(menu);
ui->search->setPlaceholderText(tr("Search"));
@ -74,7 +74,7 @@ AutoFillManager::AutoFillManager(QWidget* parent)
ui->backendOptions->setVisible(m_passwordManager->activeBackend()->hasSettings());
// Load passwords
QTimer::singleShot(0, this, SLOT(loadPasswords()));
QTimer::singleShot(0, this, &AutoFillManager::loadPasswords);
}
void AutoFillManager::loadPasswords()
@ -304,7 +304,7 @@ void AutoFillManager::importPasswords()
return;
}
QTimer::singleShot(0, this, SLOT(slotImportPasswords()));
QTimer::singleShot(0, this, &AutoFillManager::slotImportPasswords);
}
void AutoFillManager::exportPasswords()
@ -315,7 +315,7 @@ void AutoFillManager::exportPasswords()
return;
}
QTimer::singleShot(0, this, SLOT(slotExportPasswords()));
QTimer::singleShot(0, this, &AutoFillManager::slotExportPasswords);
}
void AutoFillManager::slotImportPasswords()
@ -362,7 +362,7 @@ void AutoFillManager::currentPasswordBackendChanged()
ui->currentBackend->setText(QString("<b>%1</b>").arg(m_passwordManager->activeBackend()->name()));
ui->backendOptions->setVisible(m_passwordManager->activeBackend()->hasSettings());
QTimer::singleShot(0, this, SLOT(loadPasswords()));
QTimer::singleShot(0, this, &AutoFillManager::loadPasswords);
}
void AutoFillManager::passwordContextMenu(const QPoint &pos)

View File

@ -47,9 +47,9 @@ PluginsManager::PluginsManager(QWidget* parent)
ui->list->setEnabled(appPluginsEnabled);
connect(ui->butSettings, SIGNAL(clicked()), this, SLOT(settingsClicked()));
connect(ui->list, SIGNAL(currentItemChanged(QListWidgetItem*,QListWidgetItem*)), this, SLOT(currentChanged(QListWidgetItem*)));
connect(ui->list, SIGNAL(itemChanged(QListWidgetItem*)), this, SLOT(itemChanged(QListWidgetItem*)));
connect(ui->butSettings, &QAbstractButton::clicked, this, &PluginsManager::settingsClicked);
connect(ui->list, &QListWidget::currentItemChanged, this, &PluginsManager::currentChanged);
connect(ui->list, &QListWidget::itemChanged, this, &PluginsManager::itemChanged);
ui->list->setItemDelegate(new PluginListDelegate(ui->list));
}
@ -88,7 +88,7 @@ void PluginsManager::refresh()
{
ui->list->clear();
ui->butSettings->setEnabled(false);
disconnect(ui->list, SIGNAL(itemChanged(QListWidgetItem*)), this, SLOT(itemChanged(QListWidgetItem*)));
disconnect(ui->list, &QListWidget::itemChanged, this, &PluginsManager::itemChanged);
const QList<Plugins::Plugin> &allPlugins = mApp->plugins()->getAvailablePlugins();
@ -119,7 +119,7 @@ void PluginsManager::refresh()
sortItems();
connect(ui->list, SIGNAL(itemChanged(QListWidgetItem*)), this, SLOT(itemChanged(QListWidgetItem*)));
connect(ui->list, &QListWidget::itemChanged, this, &PluginsManager::itemChanged);
}
void PluginsManager::sortItems()
@ -177,7 +177,7 @@ void PluginsManager::itemChanged(QListWidgetItem* item)
mApp->plugins()->unloadPlugin(&plugin);
}
disconnect(ui->list, SIGNAL(itemChanged(QListWidgetItem*)), this, SLOT(itemChanged(QListWidgetItem*)));
disconnect(ui->list, &QListWidget::itemChanged, this, &PluginsManager::itemChanged);
if (item->checkState() == Qt::Checked && !plugin.isLoaded()) {
item->setCheckState(Qt::Unchecked);
@ -186,7 +186,7 @@ void PluginsManager::itemChanged(QListWidgetItem* item)
item->setData(Qt::UserRole + 10, QVariant::fromValue(plugin));
connect(ui->list, SIGNAL(itemChanged(QListWidgetItem*)), this, SLOT(itemChanged(QListWidgetItem*)));
connect(ui->list, &QListWidget::itemChanged, this, &PluginsManager::itemChanged);
currentChanged(ui->list->currentItem());

View File

@ -195,8 +195,8 @@ Preferences::Preferences(BrowserWindow* window)
connect(ui->afterLaunch, SIGNAL(currentIndexChanged(int)), this, SLOT(afterLaunchChanged(int)));
connect(ui->newTab, SIGNAL(currentIndexChanged(int)), this, SLOT(newTabChanged(int)));
if (m_window) {
connect(ui->useCurrentBut, SIGNAL(clicked()), this, SLOT(useActualHomepage()));
connect(ui->newTabUseCurrent, SIGNAL(clicked()), this, SLOT(useActualNewTab()));
connect(ui->useCurrentBut, &QAbstractButton::clicked, this, &Preferences::useActualHomepage);
connect(ui->newTabUseCurrent, &QAbstractButton::clicked, this, &Preferences::useActualNewTab);
}
else {
ui->useCurrentBut->setEnabled(false);
@ -214,8 +214,8 @@ Preferences::Preferences(BrowserWindow* window)
}
}
connect(ui->createProfile, SIGNAL(clicked()), this, SLOT(createProfile()));
connect(ui->deleteProfile, SIGNAL(clicked()), this, SLOT(deleteProfile()));
connect(ui->createProfile, &QAbstractButton::clicked, this, &Preferences::createProfile);
connect(ui->deleteProfile, &QAbstractButton::clicked, this, &Preferences::deleteProfile);
connect(ui->startProfile, SIGNAL(currentIndexChanged(int)), this, SLOT(startProfileIndexChanged(int)));
startProfileIndexChanged(ui->startProfile->currentIndex());
@ -227,8 +227,8 @@ Preferences::Preferences(BrowserWindow* window)
ui->showBookmarksToolbar->setChecked(settings.value("showBookmarksToolbar", false).toBool());
ui->instantBookmarksToolbar->setDisabled(settings.value("showBookmarksToolbar", false).toBool());
ui->showBookmarksToolbar->setDisabled(settings.value("instantBookmarksToolbar").toBool());
connect(ui->instantBookmarksToolbar, SIGNAL(toggled(bool)), ui->showBookmarksToolbar, SLOT(setDisabled(bool)));
connect(ui->showBookmarksToolbar, SIGNAL(toggled(bool)), ui->instantBookmarksToolbar, SLOT(setDisabled(bool)));
connect(ui->instantBookmarksToolbar, &QAbstractButton::toggled, ui->showBookmarksToolbar, &QWidget::setDisabled);
connect(ui->showBookmarksToolbar, &QAbstractButton::toggled, ui->instantBookmarksToolbar, &QWidget::setDisabled);
ui->showNavigationToolbar->setChecked(settings.value("showNavigationToolbar", true).toBool());
int currentSettingsPage = settings.value("settingsDialogPage", 0).toInt(0);
settings.endGroup();
@ -265,7 +265,7 @@ Preferences::Preferences(BrowserWindow* window)
ui->progressBarColorSelector->setEnabled(pbInABuseCC);
QColor pbColor = settings.value("CustomProgressColor", palette().color(QPalette::Highlight)).value<QColor>();
setProgressBarColorIcon(pbColor);
connect(ui->customColorToolButton, SIGNAL(clicked(bool)), SLOT(selectCustomProgressBarColor()));
connect(ui->customColorToolButton, &QAbstractButton::clicked, this, &Preferences::selectCustomProgressBarColor);
connect(ui->resetProgressBarcolor, SIGNAL(clicked()), SLOT(setProgressBarColorIcon()));
settings.endGroup();
@ -276,7 +276,7 @@ Preferences::Preferences(BrowserWindow* window)
ui->searchWithDefaultEngine->setChecked(settings.value("SearchWithDefaultEngine", false).toBool());
ui->showABSearchSuggestions->setEnabled(searchFromAB);
ui->showABSearchSuggestions->setChecked(settings.value("showSearchSuggestions", true).toBool());
connect(ui->searchFromAddressBar, SIGNAL(toggled(bool)), this, SLOT(searchFromAddressBarChanged(bool)));
connect(ui->searchFromAddressBar, &QAbstractButton::toggled, this, &Preferences::searchFromAddressBarChanged);
settings.endGroup();
// BROWSING
@ -305,8 +305,8 @@ Preferences::Preferences(BrowserWindow* window)
ui->removeCache->setChecked(settings.value("deleteCacheOnClose", false).toBool());
ui->cacheMB->setValue(settings.value("LocalCacheSize", 50).toInt());
ui->cachePath->setText(settings.value("CachePath", QWebEngineProfile::defaultProfile()->cachePath()).toString());
connect(ui->allowCache, SIGNAL(clicked(bool)), this, SLOT(allowCacheChanged(bool)));
connect(ui->changeCachePath, SIGNAL(clicked()), this, SLOT(changeCachePathClicked()));
connect(ui->allowCache, &QAbstractButton::clicked, this, &Preferences::allowCacheChanged);
connect(ui->changeCachePath, &QAbstractButton::clicked, this, &Preferences::changeCachePathClicked);
allowCacheChanged(ui->allowCache->isChecked());
//PASSWORD MANAGER
@ -320,18 +320,18 @@ Preferences::Preferences(BrowserWindow* window)
if (!ui->saveHistory->isChecked()) {
ui->deleteHistoryOnClose->setEnabled(false);
}
connect(ui->saveHistory, SIGNAL(toggled(bool)), this, SLOT(saveHistoryChanged(bool)));
connect(ui->saveHistory, &QAbstractButton::toggled, this, &Preferences::saveHistoryChanged);
// Html5Storage
ui->html5storage->setChecked(settings.value("HTML5StorageEnabled", true).toBool());
ui->deleteHtml5storageOnClose->setChecked(settings.value("deleteHTML5StorageOnClose", false).toBool());
connect(ui->html5storage, SIGNAL(toggled(bool)), this, SLOT(allowHtml5storageChanged(bool)));
connect(ui->html5storage, &QAbstractButton::toggled, this, &Preferences::allowHtml5storageChanged);
// Other
ui->doNotTrack->setChecked(settings.value("DoNotTrack", false).toBool());
//CSS Style
ui->userStyleSheet->setText(settings.value("userStyleSheet", "").toString());
connect(ui->chooseUserStylesheet, SIGNAL(clicked()), this, SLOT(chooseUserStyleClicked()));
connect(ui->chooseUserStylesheet, &QAbstractButton::clicked, this, &Preferences::chooseUserStyleClicked);
settings.endGroup();
//DOWNLOADS
@ -348,12 +348,12 @@ Preferences::Preferences(BrowserWindow* window)
ui->externalDownExecutable->setText(settings.value("ExternalManagerExecutable", "").toString());
ui->externalDownArguments->setText(settings.value("ExternalManagerArguments", "").toString());
connect(ui->useExternalDownManager, SIGNAL(toggled(bool)), this, SLOT(useExternalDownManagerChanged(bool)));
connect(ui->useExternalDownManager, &QAbstractButton::toggled, this, &Preferences::useExternalDownManagerChanged);
connect(ui->useDefined, SIGNAL(toggled(bool)), this, SLOT(downLocChanged(bool)));
connect(ui->downButt, SIGNAL(clicked()), this, SLOT(chooseDownPath()));
connect(ui->chooseExternalDown, SIGNAL(clicked()), this, SLOT(chooseExternalDownloadManager()));
connect(ui->useDefined, &QAbstractButton::toggled, this, &Preferences::downLocChanged);
connect(ui->downButt, &QAbstractButton::clicked, this, &Preferences::chooseDownPath);
connect(ui->chooseExternalDown, &QAbstractButton::clicked, this, &Preferences::chooseExternalDownloadManager);
downLocChanged(ui->useDefined->isChecked());
useExternalDownManagerChanged(ui->useExternalDownManager->isChecked());
settings.endGroup();
@ -501,19 +501,19 @@ Preferences::Preferences(BrowserWindow* window)
settings.endGroup();
setManualProxyConfigurationEnabled(ui->manualProxy->isChecked());
connect(ui->manualProxy, SIGNAL(toggled(bool)), this, SLOT(setManualProxyConfigurationEnabled(bool)));
connect(ui->manualProxy, &QAbstractButton::toggled, this, &Preferences::setManualProxyConfigurationEnabled);
//CONNECTS
connect(ui->buttonBox, SIGNAL(clicked(QAbstractButton*)), this, SLOT(buttonClicked(QAbstractButton*)));
connect(ui->cookieManagerBut, SIGNAL(clicked()), this, SLOT(showCookieManager()));
connect(ui->html5permissions, SIGNAL(clicked()), this, SLOT(showHtml5Permissions()));
connect(ui->preferredLanguages, SIGNAL(clicked()), this, SLOT(showAcceptLanguage()));
connect(ui->deleteHtml5storage, SIGNAL(clicked()), this, SLOT(deleteHtml5storage()));
connect(ui->uaManager, SIGNAL(clicked()), this, SLOT(openUserAgentManager()));
connect(ui->jsOptionsButton, SIGNAL(clicked()), this, SLOT(openJsOptions()));
connect(ui->searchEngines, SIGNAL(clicked()), this, SLOT(openSearchEnginesManager()));
connect(ui->buttonBox, &QDialogButtonBox::clicked, this, &Preferences::buttonClicked);
connect(ui->cookieManagerBut, &QAbstractButton::clicked, this, &Preferences::showCookieManager);
connect(ui->html5permissions, &QAbstractButton::clicked, this, &Preferences::showHtml5Permissions);
connect(ui->preferredLanguages, &QAbstractButton::clicked, this, &Preferences::showAcceptLanguage);
connect(ui->deleteHtml5storage, &QAbstractButton::clicked, this, &Preferences::deleteHtml5storage);
connect(ui->uaManager, &QAbstractButton::clicked, this, &Preferences::openUserAgentManager);
connect(ui->jsOptionsButton, &QAbstractButton::clicked, this, &Preferences::openJsOptions);
connect(ui->searchEngines, &QAbstractButton::clicked, this, &Preferences::openSearchEnginesManager);
connect(ui->listWidget, SIGNAL(currentItemChanged(QListWidgetItem*,QListWidgetItem*)), this, SLOT(showStackedPage(QListWidgetItem*)));
connect(ui->listWidget, &QListWidget::currentItemChanged, this, &Preferences::showStackedPage);
ui->listWidget->setItemSelected(ui->listWidget->itemAt(5, 5), true);
ui->listWidget->setCurrentRow(currentSettingsPage);

View File

@ -65,8 +65,8 @@ ThemeManager::ThemeManager(QWidget* parent, Preferences* preferences)
}
}
connect(ui->listWidget, SIGNAL(currentItemChanged(QListWidgetItem*,QListWidgetItem*)), this, SLOT(currentChanged()));
connect(ui->license, SIGNAL(clicked(QPoint)), this, SLOT(showLicense()));
connect(ui->listWidget, &QListWidget::currentItemChanged, this, &ThemeManager::currentChanged);
connect(ui->license, &ClickableLabel::clicked, this, &ThemeManager::showLicense);
currentChanged();
}

View File

@ -79,13 +79,13 @@ UserAgentDialog::UserAgentDialog(QWidget* parent)
ui->table->sortByColumn(-1);
connect(ui->add, SIGNAL(clicked()), this, SLOT(addSite()));
connect(ui->remove, SIGNAL(clicked()), this, SLOT(removeSite()));
connect(ui->edit, SIGNAL(clicked()), this, SLOT(editSite()));
connect(ui->table, SIGNAL(itemDoubleClicked(QTableWidgetItem*)), this, SLOT(editSite()));
connect(ui->add, &QAbstractButton::clicked, this, &UserAgentDialog::addSite);
connect(ui->remove, &QAbstractButton::clicked, this, &UserAgentDialog::removeSite);
connect(ui->edit, &QAbstractButton::clicked, this, &UserAgentDialog::editSite);
connect(ui->table, &QTableWidget::itemDoubleClicked, this, &UserAgentDialog::editSite);
connect(ui->changeGlobal, SIGNAL(clicked(bool)), this, SLOT(enableGlobalComboBox(bool)));
connect(ui->changePerSite, SIGNAL(clicked(bool)), this, SLOT(enablePerSiteFrame(bool)));
connect(ui->changeGlobal, &QAbstractButton::clicked, this, &UserAgentDialog::enableGlobalComboBox);
connect(ui->changePerSite, &QAbstractButton::clicked, this, &UserAgentDialog::enablePerSiteFrame);
enableGlobalComboBox(ui->changeGlobal->isChecked());
enablePerSiteFrame(ui->changePerSite->isChecked());
@ -210,8 +210,8 @@ bool UserAgentDialog::showEditDialog(const QString &title, QString* rSite, QStri
box->addButton(QDialogButtonBox::Ok);
box->addButton(QDialogButtonBox::Cancel);
connect(box, SIGNAL(rejected()), dialog, SLOT(reject()));
connect(box, SIGNAL(accepted()), dialog, SLOT(accept()));
connect(box, &QDialogButtonBox::rejected, dialog, &QDialog::reject);
connect(box, &QDialogButtonBox::accepted, dialog, &QDialog::accept);
layout->addRow(new QLabel(tr("Site domain: ")), editSite);
layout->addRow(new QLabel(tr("User Agent: ")), editAgent);

View File

@ -43,7 +43,7 @@ SessionManager::SessionManager(QObject* parent)
, m_secondBackupSession(DataPaths::currentProfilePath() + QL1S("/session.dat.old1"))
{
QFileSystemWatcher* sessionFilesWatcher = new QFileSystemWatcher({DataPaths::path(DataPaths::Sessions)}, this);
connect(sessionFilesWatcher, SIGNAL(directoryChanged(QString)), this, SLOT(sessionsDirectoryChanged()));
connect(sessionFilesWatcher, &QFileSystemWatcher::directoryChanged, this, &SessionManager::sessionsDirectoryChanged);
connect(sessionFilesWatcher, &QFileSystemWatcher::directoryChanged, this, &SessionManager::sessionsMetaDataChanged);
loadSettings();

View File

@ -34,12 +34,12 @@ BookmarksSidebar::BookmarksSidebar(BrowserWindow* window, QWidget* parent)
ui->setupUi(this);
ui->tree->setViewType(BookmarksTreeView::BookmarksSidebarViewType);
connect(ui->tree, SIGNAL(bookmarkActivated(BookmarkItem*)), this, SLOT(bookmarkActivated(BookmarkItem*)));
connect(ui->tree, SIGNAL(bookmarkCtrlActivated(BookmarkItem*)), this, SLOT(bookmarkCtrlActivated(BookmarkItem*)));
connect(ui->tree, SIGNAL(bookmarkShiftActivated(BookmarkItem*)), this, SLOT(bookmarkShiftActivated(BookmarkItem*)));
connect(ui->tree, SIGNAL(contextMenuRequested(QPoint)), this, SLOT(createContextMenu(QPoint)));
connect(ui->tree, &BookmarksTreeView::bookmarkActivated, this, &BookmarksSidebar::bookmarkActivated);
connect(ui->tree, &BookmarksTreeView::bookmarkCtrlActivated, this, &BookmarksSidebar::bookmarkCtrlActivated);
connect(ui->tree, &BookmarksTreeView::bookmarkShiftActivated, this, &BookmarksSidebar::bookmarkShiftActivated);
connect(ui->tree, &BookmarksTreeView::contextMenuRequested, this, &BookmarksSidebar::createContextMenu);
connect(ui->search, SIGNAL(textChanged(QString)), ui->tree, SLOT(search(QString)));
connect(ui->search, &QLineEdit::textChanged, ui->tree, &BookmarksTreeView::search);
}
BookmarksSidebar::~BookmarksSidebar()
@ -110,7 +110,7 @@ void BookmarksSidebar::createContextMenu(const QPoint &pos)
connect(actNewTab, SIGNAL(triggered()), this, SLOT(openBookmarkInNewTab()));
connect(actNewWindow, SIGNAL(triggered()), this, SLOT(openBookmarkInNewWindow()));
connect(actNewPrivateWindow, SIGNAL(triggered()), this, SLOT(openBookmarkInNewPrivateWindow()));
connect(actDelete, SIGNAL(triggered()), this, SLOT(deleteBookmarks()));
connect(actDelete, &QAction::triggered, this, &BookmarksSidebar::deleteBookmarks);
bool canBeDeleted = false;
QList<BookmarkItem*> items = ui->tree->selectedBookmarks();

View File

@ -32,12 +32,12 @@ HistorySideBar::HistorySideBar(BrowserWindow* window, QWidget* parent)
ui->setupUi(this);
ui->historyTree->setViewType(HistoryTreeView::HistorySidebarViewType);
connect(ui->historyTree, SIGNAL(urlActivated(QUrl)), this, SLOT(urlActivated(QUrl)));
connect(ui->historyTree, SIGNAL(urlCtrlActivated(QUrl)), this, SLOT(urlCtrlActivated(QUrl)));
connect(ui->historyTree, SIGNAL(urlShiftActivated(QUrl)), this, SLOT(urlShiftActivated(QUrl)));
connect(ui->historyTree, SIGNAL(contextMenuRequested(QPoint)), this, SLOT(createContextMenu(QPoint)));
connect(ui->historyTree, &HistoryTreeView::urlActivated, this, &HistorySideBar::urlActivated);
connect(ui->historyTree, &HistoryTreeView::urlCtrlActivated, this, &HistorySideBar::urlCtrlActivated);
connect(ui->historyTree, &HistoryTreeView::urlShiftActivated, this, &HistorySideBar::urlShiftActivated);
connect(ui->historyTree, &HistoryTreeView::contextMenuRequested, this, &HistorySideBar::createContextMenu);
connect(ui->search, SIGNAL(textEdited(QString)), ui->historyTree, SLOT(search(QString)));
connect(ui->search, &QLineEdit::textEdited, ui->historyTree, &HistoryTreeView::search);
}
void HistorySideBar::urlActivated(const QUrl &url)
@ -92,7 +92,7 @@ void HistorySideBar::createContextMenu(const QPoint &pos)
connect(actNewTab, SIGNAL(triggered()), this, SLOT(openUrlInNewTab()));
connect(actNewWindow, SIGNAL(triggered()), this, SLOT(openUrlInNewWindow()));
connect(actNewPrivateWindow, SIGNAL(triggered()), this, SLOT(openUrlInNewPrivateWindow()));
connect(actDelete, SIGNAL(triggered()), ui->historyTree, SLOT(removeSelectedItems()));
connect(actDelete, &QAction::triggered, ui->historyTree, &HistoryTreeView::removeSelectedItems);
if (ui->historyTree->selectedUrl().isEmpty()) {
actNewTab->setDisabled(true);

View File

@ -104,14 +104,14 @@ void SideBarManager::createMenu(QMenu* menu)
QActionGroup *group = new QActionGroup(menu);
QAction* act = menu->addAction(SideBar::tr("Bookmarks"), this, SLOT(slotShowSideBar()));
QAction* act = menu->addAction(SideBar::tr("Bookmarks"), this, &SideBarManager::slotShowSideBar);
act->setCheckable(true);
act->setShortcut(QKeySequence("Ctrl+Shift+B"));
act->setData("Bookmarks");
act->setChecked(m_activeBar == QL1S("Bookmarks"));
group->addAction(act);
act = menu->addAction(SideBar::tr("History"), this, SLOT(slotShowSideBar()));
act = menu->addAction(SideBar::tr("History"), this, &SideBarManager::slotShowSideBar);
act->setCheckable(true);
act->setShortcut(QKeySequence("Ctrl+H"));
act->setData("History");
@ -123,7 +123,7 @@ void SideBarManager::createMenu(QMenu* menu)
QAction* act = sidebar.data()->createMenuAction();
act->setData(s_sidebars.key(sidebar));
act->setChecked(m_activeBar == s_sidebars.key(sidebar));
connect(act, SIGNAL(triggered()), this, SLOT(slotShowSideBar()));
connect(act, &QAction::triggered, this, &SideBarManager::slotShowSideBar);
menu->addAction(act);
group->addAction(act);
}

View File

@ -62,10 +62,10 @@ ComboTabBar::ComboTabBar(QWidget* parent)
m_mainTabBar->setScrollArea(m_mainTabBarWidget->scrollArea());
m_pinnedTabBar->setScrollArea(m_pinnedTabBarWidget->scrollArea());
connect(m_mainTabBarWidget->scrollBar(), SIGNAL(rangeChanged(int,int)), this, SLOT(setMinimumWidths()));
connect(m_mainTabBarWidget->scrollBar(), SIGNAL(valueChanged(int)), this, SIGNAL(scrollBarValueChanged(int)));
connect(m_pinnedTabBarWidget->scrollBar(), SIGNAL(rangeChanged(int,int)), this, SLOT(setMinimumWidths()));
connect(m_pinnedTabBarWidget->scrollBar(), SIGNAL(valueChanged(int)), this, SIGNAL(scrollBarValueChanged(int)));
connect(m_mainTabBarWidget->scrollBar(), &QAbstractSlider::rangeChanged, this, &ComboTabBar::setMinimumWidths);
connect(m_mainTabBarWidget->scrollBar(), &QAbstractSlider::valueChanged, this, &ComboTabBar::scrollBarValueChanged);
connect(m_pinnedTabBarWidget->scrollBar(), &QAbstractSlider::rangeChanged, this, &ComboTabBar::setMinimumWidths);
connect(m_pinnedTabBarWidget->scrollBar(), &QAbstractSlider::valueChanged, this, &ComboTabBar::scrollBarValueChanged);
connect(this, SIGNAL(overFlowChanged(bool)), m_mainTabBarWidget, SLOT(overFlowChanged(bool)));
m_mainTabBar->setActiveTabBar(true);
@ -92,13 +92,13 @@ ComboTabBar::ComboTabBar(QWidget* parent)
m_mainLayout->addWidget(m_rightContainer);
setLayout(m_mainLayout);
connect(m_mainTabBar, SIGNAL(currentChanged(int)), this, SLOT(slotCurrentChanged(int)));
connect(m_mainTabBar, SIGNAL(tabCloseRequested(int)), this, SLOT(slotTabCloseRequested(int)));
connect(m_mainTabBar, SIGNAL(tabMoved(int,int)), this, SLOT(slotTabMoved(int,int)));
connect(m_mainTabBar, &QTabBar::currentChanged, this, &ComboTabBar::slotCurrentChanged);
connect(m_mainTabBar, &QTabBar::tabCloseRequested, this, &ComboTabBar::slotTabCloseRequested);
connect(m_mainTabBar, &QTabBar::tabMoved, this, &ComboTabBar::slotTabMoved);
connect(m_pinnedTabBar, SIGNAL(currentChanged(int)), this, SLOT(slotCurrentChanged(int)));
connect(m_pinnedTabBar, SIGNAL(tabCloseRequested(int)), this, SLOT(slotTabCloseRequested(int)));
connect(m_pinnedTabBar, SIGNAL(tabMoved(int,int)), this, SLOT(slotTabMoved(int,int)));
connect(m_pinnedTabBar, &QTabBar::currentChanged, this, &ComboTabBar::slotCurrentChanged);
connect(m_pinnedTabBar, &QTabBar::tabCloseRequested, this, &ComboTabBar::slotTabCloseRequested);
connect(m_pinnedTabBar, &QTabBar::tabMoved, this, &ComboTabBar::slotTabMoved);
setAutoFillBackground(false);
m_mainTabBar->setAutoFillBackground(false);
@ -561,7 +561,7 @@ void ComboTabBar::insertCloseButton(int index)
QAbstractButton* closeButton = new CloseButton(this);
closeButton->setFixedSize(closeButtonSize());
closeButton->setToolTip(m_closeButtonsToolTip);
connect(closeButton, SIGNAL(clicked()), this, SLOT(closeTabFromButton()));
connect(closeButton, &QAbstractButton::clicked, this, &ComboTabBar::closeTabFromButton);
m_mainTabBar->setTabButton(index, closeButtonPosition(), closeButton);
}
@ -978,7 +978,7 @@ void ComboTabBar::setMinimumWidths()
if (realTabBarWidth <= width()) {
if (m_mainBarOverFlowed) {
m_mainBarOverFlowed = false;
QTimer::singleShot(0, this, SLOT(emitOverFlowChanged()));
QTimer::singleShot(0, this, &ComboTabBar::emitOverFlowChanged);
}
m_mainTabBar->useFastTabSizeHint(false);
@ -987,7 +987,7 @@ void ComboTabBar::setMinimumWidths()
else {
if (!m_mainBarOverFlowed) {
m_mainBarOverFlowed = true;
QTimer::singleShot(0, this, SLOT(emitOverFlowChanged()));
QTimer::singleShot(0, this, &ComboTabBar::emitOverFlowChanged);
}
// All tabs have now same width, we can use fast tabSizeHint
@ -1558,8 +1558,8 @@ TabBarScrollWidget::TabBarScrollWidget(QTabBar* tabBar, QWidget* parent)
m_leftScrollButton->setAutoRepeat(true);
m_leftScrollButton->setAutoRepeatDelay(200);
m_leftScrollButton->setAutoRepeatInterval(200);
connect(m_leftScrollButton, SIGNAL(pressed()), this, SLOT(scrollStart()));
connect(m_leftScrollButton, SIGNAL(doubleClicked()), this, SLOT(scrollToLeftEdge()));
connect(m_leftScrollButton, &QAbstractButton::pressed, this, &TabBarScrollWidget::scrollStart);
connect(m_leftScrollButton, &ToolButton::doubleClicked, this, &TabBarScrollWidget::scrollToLeftEdge);
connect(m_leftScrollButton, SIGNAL(middleMouseClicked()), this, SLOT(ensureVisible()));
m_rightScrollButton = new ToolButton(this);
@ -1569,8 +1569,8 @@ TabBarScrollWidget::TabBarScrollWidget(QTabBar* tabBar, QWidget* parent)
m_rightScrollButton->setAutoRepeat(true);
m_rightScrollButton->setAutoRepeatDelay(200);
m_rightScrollButton->setAutoRepeatInterval(200);
connect(m_rightScrollButton, SIGNAL(pressed()), this, SLOT(scrollStart()));
connect(m_rightScrollButton, SIGNAL(doubleClicked()), this, SLOT(scrollToRightEdge()));
connect(m_rightScrollButton, &QAbstractButton::pressed, this, &TabBarScrollWidget::scrollStart);
connect(m_rightScrollButton, &ToolButton::doubleClicked, this, &TabBarScrollWidget::scrollToRightEdge);
connect(m_rightScrollButton, SIGNAL(middleMouseClicked()), this, SLOT(ensureVisible()));
QHBoxLayout* hLayout = new QHBoxLayout;
@ -1582,7 +1582,7 @@ TabBarScrollWidget::TabBarScrollWidget(QTabBar* tabBar, QWidget* parent)
setLayout(hLayout);
m_scrollArea->viewport()->setAutoFillBackground(false);
connect(m_scrollBar, SIGNAL(valueChanged(int)), this, SLOT(updateScrollButtonsState()));
connect(m_scrollBar, &QAbstractSlider::valueChanged, this, &TabBarScrollWidget::updateScrollButtonsState);
updateScrollButtonsState();
overFlowChanged(false);

View File

@ -104,12 +104,12 @@ TabBar::TabBar(BrowserWindow* window, TabWidget* tabWidget)
setDrawBase(false);
setMovable(true);
connect(this, SIGNAL(currentChanged(int)), this, SLOT(currentTabChanged(int)));
connect(this, &ComboTabBar::currentChanged, this, &TabBar::currentTabChanged);
// ComboTabBar features
setUsesScrollButtons(true);
setCloseButtonsToolTip(BrowserWindow::tr("Close Tab"));
connect(this, SIGNAL(overFlowChanged(bool)), this, SLOT(overflowChanged(bool)));
connect(this, &ComboTabBar::overFlowChanged, this, &TabBar::overflowChanged);
tabMetrics()->init();

View File

@ -36,7 +36,7 @@ TabContextMenu::TabContextMenu(int index, BrowserWindow *window, Options options
setObjectName("tabcontextmenu");
TabWidget *tabWidget = m_window->tabWidget();
connect(this, SIGNAL(tabCloseRequested(int)), tabWidget->tabBar(), SIGNAL(tabCloseRequested(int)));
connect(this, &TabContextMenu::tabCloseRequested, tabWidget->tabBar(), &ComboTabBar::tabCloseRequested);
connect(this, SIGNAL(reloadTab(int)), tabWidget, SLOT(reloadTab(int)));
connect(this, SIGNAL(stopTab(int)), tabWidget, SLOT(stopTab(int)));
connect(this, SIGNAL(closeAllButCurrent(int)), tabWidget, SLOT(closeAllButCurrent(int)));
@ -126,8 +126,8 @@ void TabContextMenu::init()
addAction(QIcon::fromTheme("tab-detach"), tr("D&etach Tab"), this, SLOT(detachTab()));
}
addAction(webTab->isPinned() ? tr("Un&pin Tab") : tr("&Pin Tab"), this, SLOT(pinTab()));
addAction(webTab->isMuted() ? tr("Un&mute Tab") : tr("&Mute Tab"), this, SLOT(muteTab()));
addAction(webTab->isPinned() ? tr("Un&pin Tab") : tr("&Pin Tab"), this, &TabContextMenu::pinTab);
addAction(webTab->isMuted() ? tr("Un&mute Tab") : tr("&Mute Tab"), this, &TabContextMenu::muteTab);
if (!webTab->isRestored()) {
addAction(tr("Load Tab"), this, SLOT(loadTab()));
@ -136,8 +136,8 @@ void TabContextMenu::init()
}
addSeparator();
addAction(tr("Re&load All Tabs"), tabWidget, SLOT(reloadAllTabs()));
addAction(tr("Bookmark &All Tabs"), m_window, SLOT(bookmarkAllTabs()));
addAction(tr("Re&load All Tabs"), tabWidget, &TabWidget::reloadAllTabs);
addAction(tr("Bookmark &All Tabs"), m_window, &BrowserWindow::bookmarkAllTabs);
addSeparator();
if (m_options & ShowCloseOtherTabsActions) {
@ -148,12 +148,12 @@ void TabContextMenu::init()
}
addAction(m_window->action(QSL("Other/RestoreClosedTab")));
addAction(QIcon::fromTheme("window-close"), tr("Cl&ose Tab"), this, SLOT(closeTab()));
addAction(QIcon::fromTheme("window-close"), tr("Cl&ose Tab"), this, &TabContextMenu::closeTab);
} else {
addAction(IconProvider::newTabIcon(), tr("&New tab"), m_window, SLOT(addTab()));
addAction(IconProvider::newTabIcon(), tr("&New tab"), m_window, &BrowserWindow::addTab);
addSeparator();
addAction(tr("Reloa&d All Tabs"), tabWidget, SLOT(reloadAllTabs()));
addAction(tr("Bookmark &All Tabs"), m_window, SLOT(bookmarkAllTabs()));
addAction(tr("Reloa&d All Tabs"), tabWidget, &TabWidget::reloadAllTabs);
addAction(tr("Bookmark &All Tabs"), m_window, &BrowserWindow::bookmarkAllTabs);
addSeparator();
addAction(m_window->action(QSL("Other/RestoreClosedTab")));
}

View File

@ -36,7 +36,7 @@ TabIcon::TabIcon(QWidget* parent)
m_updateTimer = new QTimer(this);
m_updateTimer->setInterval(data()->animationInterval);
connect(m_updateTimer, SIGNAL(timeout()), this, SLOT(updateAnimationFrame()));
connect(m_updateTimer, &QTimer::timeout, this, &TabIcon::updateAnimationFrame);
m_hideTimer = new QTimer(this);
m_hideTimer->setInterval(250);
@ -49,8 +49,8 @@ void TabIcon::setWebTab(WebTab* tab)
{
m_tab = tab;
connect(m_tab->webView(), SIGNAL(loadStarted()), this, SLOT(showLoadingAnimation()));
connect(m_tab->webView(), SIGNAL(loadFinished(bool)), this, SLOT(hideLoadingAnimation()));
connect(m_tab->webView(), &QWebEngineView::loadStarted, this, &TabIcon::showLoadingAnimation);
connect(m_tab->webView(), &QWebEngineView::loadFinished, this, &TabIcon::hideLoadingAnimation);
connect(m_tab->webView(), &WebView::iconChanged, this, &TabIcon::updateIcon);
connect(m_tab->webView(), &WebView::backgroundActivityChanged, this, [this]() { update(); });

View File

@ -44,7 +44,7 @@ TabStackedWidget::TabStackedWidget(QWidget* parent)
m_mainLayout->addWidget(m_stack);
setLayout(m_mainLayout);
connect(m_stack, SIGNAL(widgetRemoved(int)), this, SLOT(tabWasRemoved(int)));
connect(m_stack, &QStackedWidget::widgetRemoved, this, &TabStackedWidget::tabWasRemoved);
}
TabStackedWidget::~TabStackedWidget()
@ -70,12 +70,12 @@ void TabStackedWidget::setTabBar(ComboTabBar* tb)
m_tabBar = tb;
setFocusProxy(m_tabBar);
connect(m_tabBar, SIGNAL(currentChanged(int)), this, SLOT(showTab(int)));
connect(m_tabBar, &ComboTabBar::currentChanged, this, &TabStackedWidget::showTab);
connect(m_tabBar, &ComboTabBar::tabMoved, this, &TabStackedWidget::tabWasMoved);
connect(m_tabBar, SIGNAL(overFlowChanged(bool)), this, SLOT(setUpLayout()));
connect(m_tabBar, &ComboTabBar::overFlowChanged, this, &TabStackedWidget::setUpLayout);
if (m_tabBar->tabsClosable()) {
connect(m_tabBar, SIGNAL(tabCloseRequested(int)), this, SIGNAL(tabCloseRequested(int)));
connect(m_tabBar, &ComboTabBar::tabCloseRequested, this, &TabStackedWidget::tabCloseRequested);
}
setDocumentMode(m_tabBar->documentMode());
@ -227,7 +227,7 @@ int TabStackedWidget::insertTab(int index, QWidget* w, const QString &label, boo
if (m_currentIndex >= index)
++m_currentIndex;
QTimer::singleShot(0, this, SLOT(setUpLayout()));
QTimer::singleShot(0, this, &TabStackedWidget::setUpLayout);
return index;
}

View File

@ -96,28 +96,28 @@ TabWidget::TabWidget(BrowserWindow *window, QWidget *parent)
connect(this, &TabWidget::changed, mApp, &MainApplication::changeOccurred);
connect(this, &TabStackedWidget::pinStateChanged, this, &TabWidget::changed);
connect(m_tabBar, SIGNAL(tabCloseRequested(int)), this, SLOT(requestCloseTab(int)));
connect(m_tabBar, &ComboTabBar::tabCloseRequested, this, &TabWidget::requestCloseTab);
connect(m_tabBar, &TabBar::tabMoved, this, &TabWidget::tabWasMoved);
connect(m_tabBar, SIGNAL(moveAddTabButton(int)), this, SLOT(moveAddTabButton(int)));
connect(m_tabBar, &TabBar::moveAddTabButton, this, &TabWidget::moveAddTabButton);
connect(mApp, SIGNAL(settingsReloaded()), this, SLOT(loadSettings()));
connect(mApp, &MainApplication::settingsReloaded, this, &TabWidget::loadSettings);
m_menuTabs = new MenuTabs(this);
connect(m_menuTabs, SIGNAL(closeTab(int)), this, SLOT(requestCloseTab(int)));
connect(m_menuTabs, &MenuTabs::closeTab, this, &TabWidget::requestCloseTab);
m_menuClosedTabs = new QMenu(this);
// AddTab button displayed next to last tab
m_buttonAddTab = new AddTabButton(this, m_tabBar);
m_buttonAddTab->setProperty("outside-tabbar", false);
connect(m_buttonAddTab, SIGNAL(clicked()), m_window, SLOT(addTab()));
connect(m_buttonAddTab, &QAbstractButton::clicked, m_window, &BrowserWindow::addTab);
// AddTab button displayed outside tabbar (as corner widget)
m_buttonAddTab2 = new AddTabButton(this, m_tabBar);
m_buttonAddTab2->setProperty("outside-tabbar", true);
m_buttonAddTab2->hide();
connect(m_buttonAddTab2, SIGNAL(clicked()), m_window, SLOT(addTab()));
connect(m_buttonAddTab2, &QAbstractButton::clicked, m_window, &BrowserWindow::addTab);
// ClosedTabs button displayed as a permanent corner widget
m_buttonClosedTabs = new ToolButton(m_tabBar);
@ -128,7 +128,7 @@ TabWidget::TabWidget(BrowserWindow *window, QWidget *parent)
m_buttonClosedTabs->setAutoRaise(true);
m_buttonClosedTabs->setFocusPolicy(Qt::NoFocus);
m_buttonClosedTabs->setShowMenuInside(true);
connect(m_buttonClosedTabs, SIGNAL(aboutToShowMenu()), this, SLOT(aboutToShowClosedTabsMenu()));
connect(m_buttonClosedTabs, &ToolButton::aboutToShowMenu, this, &TabWidget::aboutToShowClosedTabsMenu);
// ListTabs button is showed only when tabbar overflows
m_buttonListTabs = new ToolButton(m_tabBar);
@ -140,12 +140,12 @@ TabWidget::TabWidget(BrowserWindow *window, QWidget *parent)
m_buttonListTabs->setFocusPolicy(Qt::NoFocus);
m_buttonListTabs->setShowMenuInside(true);
m_buttonListTabs->hide();
connect(m_buttonListTabs, SIGNAL(aboutToShowMenu()), this, SLOT(aboutToShowTabsMenu()));
connect(m_buttonListTabs, &ToolButton::aboutToShowMenu, this, &TabWidget::aboutToShowTabsMenu);
m_tabBar->addCornerWidget(m_buttonAddTab2, Qt::TopRightCorner);
m_tabBar->addCornerWidget(m_buttonClosedTabs, Qt::TopRightCorner);
m_tabBar->addCornerWidget(m_buttonListTabs, Qt::TopRightCorner);
connect(m_tabBar, SIGNAL(overFlowChanged(bool)), this, SLOT(tabBarOverFlowChanged(bool)));
connect(m_tabBar, &ComboTabBar::overFlowChanged, this, &TabWidget::tabBarOverFlowChanged);
loadSettings();
}
@ -275,7 +275,7 @@ void TabWidget::aboutToShowTabsMenu()
action->setText(QzTools::truncatedText(title, 40));
action->setData(QVariant::fromValue(qobject_cast<QWidget*>(tab)));
connect(action, SIGNAL(triggered()), this, SLOT(actionChangeIndex()));
connect(action, &QAction::triggered, this, &TabWidget::actionChangeIndex);
m_menuTabs->addAction(action);
}
}
@ -296,8 +296,8 @@ void TabWidget::aboutToShowClosedTabsMenu()
}
else {
m_menuClosedTabs->addSeparator();
m_menuClosedTabs->addAction(tr("Restore All Closed Tabs"), this, SLOT(restoreAllClosedTabs()));
m_menuClosedTabs->addAction(QIcon::fromTheme(QSL("edit-clear")), tr("Clear list"), this, SLOT(clearClosedTabsList()));
m_menuClosedTabs->addAction(tr("Restore All Closed Tabs"), this, &TabWidget::restoreAllClosedTabs);
m_menuClosedTabs->addAction(QIcon::fromTheme(QSL("edit-clear")), tr("Clear list"), this, &TabWidget::clearClosedTabsList);
}
}
@ -361,9 +361,9 @@ int TabWidget::addView(const LoadRequest &req, const QString &title, const Qz::N
m_lastBackgroundTab = webTab;
}
connect(webTab->webView(), SIGNAL(wantsCloseTab(int)), this, SLOT(closeTab(int)));
connect(webTab->webView(), SIGNAL(urlChanged(QUrl)), this, SIGNAL(changed()));
connect(webTab->webView(), SIGNAL(ipChanged(QString)), m_window->ipLabel(), SLOT(setText(QString)));
connect(webTab->webView(), &TabbedWebView::wantsCloseTab, this, &TabWidget::closeTab);
connect(webTab->webView(), &QWebEngineView::urlChanged, this, &TabWidget::changed);
connect(webTab->webView(), &TabbedWebView::ipChanged, m_window->ipLabel(), &QLabel::setText);
connect(webTab->webView(), &WebView::urlChanged, this, [this](const QUrl &url) {
if (url != m_urlOnNewTab)
m_currentTabFresh = false;
@ -410,9 +410,9 @@ int TabWidget::insertView(int index, WebTab *tab, const Qz::NewTabPositionFlags
m_lastBackgroundTab = tab;
}
connect(tab->webView(), SIGNAL(wantsCloseTab(int)), this, SLOT(closeTab(int)));
connect(tab->webView(), SIGNAL(urlChanged(QUrl)), this, SIGNAL(changed()));
connect(tab->webView(), SIGNAL(ipChanged(QString)), m_window->ipLabel(), SLOT(setText(QString)));
connect(tab->webView(), &TabbedWebView::wantsCloseTab, this, &TabWidget::closeTab);
connect(tab->webView(), &QWebEngineView::urlChanged, this, &TabWidget::changed);
connect(tab->webView(), &TabbedWebView::ipChanged, m_window->ipLabel(), &QLabel::setText);
// Make sure user notice opening new background tabs
if (!(openFlags & Qz::NT_SelectedTab)) {
@ -454,9 +454,9 @@ void TabWidget::closeTab(int index)
TabbedWebView *webView = webTab->webView();
m_locationBars->removeWidget(webView->webTab()->locationBar());
disconnect(webView, SIGNAL(wantsCloseTab(int)), this, SLOT(closeTab(int)));
disconnect(webView, SIGNAL(urlChanged(QUrl)), this, SIGNAL(changed()));
disconnect(webView, SIGNAL(ipChanged(QString)), m_window->ipLabel(), SLOT(setText(QString)));
disconnect(webView, &TabbedWebView::wantsCloseTab, this, &TabWidget::closeTab);
disconnect(webView, &QWebEngineView::urlChanged, this, &TabWidget::changed);
disconnect(webView, &TabbedWebView::ipChanged, m_window->ipLabel(), &QLabel::setText);
m_lastBackgroundTab = nullptr;
@ -690,9 +690,9 @@ void TabWidget::detachTab(WebTab* tab)
}
m_locationBars->removeWidget(tab->locationBar());
disconnect(tab->webView(), SIGNAL(wantsCloseTab(int)), this, SLOT(closeTab(int)));
disconnect(tab->webView(), SIGNAL(urlChanged(QUrl)), this, SIGNAL(changed()));
disconnect(tab->webView(), SIGNAL(ipChanged(QString)), m_window->ipLabel(), SLOT(setText(QString)));
disconnect(tab->webView(), &TabbedWebView::wantsCloseTab, this, &TabWidget::closeTab);
disconnect(tab->webView(), &QWebEngineView::urlChanged, this, &TabWidget::changed);
disconnect(tab->webView(), &TabbedWebView::ipChanged, m_window->ipLabel(), &QLabel::setText);
const int index = tab->tabIndex();

View File

@ -29,7 +29,7 @@ AnimatedWidget::AnimatedWidget(const Direction &direction, int duration, QWidget
{
m_timeLine.setDuration(duration);
m_timeLine.setFrameRange(0, 100);
connect(&m_timeLine, SIGNAL(frameChanged(int)), this, SLOT(animateFrame(int)));
connect(&m_timeLine, &QTimeLine::frameChanged, this, &AnimatedWidget::animateFrame);
setMaximumHeight(0);
}
@ -73,7 +73,7 @@ void AnimatedWidget::hide()
m_timeLine.setDirection(QTimeLine::Backward);
m_timeLine.start();
connect(&m_timeLine, SIGNAL(finished()), this, SLOT(close()));
connect(&m_timeLine, &QTimeLine::finished, this, &QWidget::close);
QWidget* p = parentWidget();
if (p) {

View File

@ -27,7 +27,7 @@ ButtonWithMenu::ButtonWithMenu(QWidget* parent)
setCursor(Qt::ArrowCursor);
setFocusPolicy(Qt::NoFocus);
connect(this, SIGNAL(aboutToShowMenu()), this, SLOT(generateMenu()));
connect(this, &ToolButton::aboutToShowMenu, this, &ButtonWithMenu::generateMenu);
connect(m_menu, &QMenu::aboutToShow, this, std::bind(&ButtonWithMenu::setDown, this, true));
connect(m_menu, &QMenu::aboutToHide, this, std::bind(&ButtonWithMenu::setDown, this, false));
}

View File

@ -33,20 +33,20 @@ DelayedFileWatcher::DelayedFileWatcher(const QStringList &paths, QObject* parent
void DelayedFileWatcher::init()
{
connect(this, SIGNAL(directoryChanged(QString)), this, SLOT(slotDirectoryChanged(QString)));
connect(this, SIGNAL(fileChanged(QString)), this, SLOT(slotFileChanged(QString)));
connect(this, &QFileSystemWatcher::directoryChanged, this, &DelayedFileWatcher::slotDirectoryChanged);
connect(this, &QFileSystemWatcher::fileChanged, this, &DelayedFileWatcher::slotFileChanged);
}
void DelayedFileWatcher::slotDirectoryChanged(const QString &path)
{
m_dirQueue.enqueue(path);
QTimer::singleShot(500, this, SLOT(dequeueDirectory()));
QTimer::singleShot(500, this, &DelayedFileWatcher::dequeueDirectory);
}
void DelayedFileWatcher::slotFileChanged(const QString &path)
{
m_fileQueue.enqueue(path);
QTimer::singleShot(500, this, SLOT(dequeueFile()));
QTimer::singleShot(500, this, &DelayedFileWatcher::dequeueFile);
}
void DelayedFileWatcher::dequeueDirectory()

View File

@ -24,7 +24,7 @@ DockTitleBarWidget::DockTitleBarWidget(const QString &title, QWidget* parent)
setupUi(this);
closeButton->setIcon(QIcon(IconProvider::standardIcon(QStyle::SP_DialogCloseButton).pixmap(16)));
label->setText(title);
connect(closeButton, SIGNAL(clicked()), parent, SLOT(close()));
connect(closeButton, &QAbstractButton::clicked, parent, &QWidget::close);
setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed);
}

View File

@ -71,7 +71,7 @@ void HeaderView::contextMenuEvent(QContextMenuEvent* event)
act->setCheckable(true);
act->setData(i);
connect(act, SIGNAL(triggered()), this, SLOT(toggleSectionVisibility()));
connect(act, &QAction::triggered, this, &HeaderView::toggleSectionVisibility);
m_menu->addAction(act);
}
}

View File

@ -68,9 +68,9 @@ HTML5PermissionsNotification::HTML5PermissionsNotification(const QUrl &origin, Q
break;
}
connect(ui->allow, SIGNAL(clicked()), this, SLOT(grantPermissions()));
connect(ui->deny, SIGNAL(clicked()), this, SLOT(denyPermissions()));
connect(ui->close, SIGNAL(clicked()), this, SLOT(denyPermissions()));
connect(ui->allow, &QAbstractButton::clicked, this, &HTML5PermissionsNotification::grantPermissions);
connect(ui->deny, &QAbstractButton::clicked, this, &HTML5PermissionsNotification::denyPermissions);
connect(ui->close, &QAbstractButton::clicked, this, &HTML5PermissionsNotification::denyPermissions);
connect(m_page.data(), &QWebEnginePage::loadStarted, this, &QObject::deleteLater);
connect(m_page.data(), &QWebEnginePage::featurePermissionRequestCanceled, this, [this](const QUrl &origin, QWebEnginePage::Feature feature) {

View File

@ -39,7 +39,7 @@ IconProvider::IconProvider()
: QWidget()
{
m_autoSaver = new AutoSaver(this);
connect(m_autoSaver, SIGNAL(save()), this, SLOT(saveIconsToDatabase()));
connect(m_autoSaver, &AutoSaver::save, this, &IconProvider::saveIconsToDatabase);
}
void IconProvider::saveIcon(WebView* view)

View File

@ -26,8 +26,8 @@ MenuBar::MenuBar(BrowserWindow* parent)
setCursor(Qt::ArrowCursor);
setContextMenuPolicy(Qt::CustomContextMenu);
connect(this, SIGNAL(customContextMenuRequested(QPoint)),
this, SLOT(contextMenuRequested(QPoint)));
connect(this, &QWidget::customContextMenuRequested,
this, &MenuBar::contextMenuRequested);
}
void MenuBar::contextMenuRequested(const QPoint &pos)

View File

@ -101,10 +101,10 @@ void ToolButton::setMenu(QMenu* menu)
Q_ASSERT(menu);
if (m_menu)
disconnect(m_menu, SIGNAL(aboutToHide()), this, SLOT(menuAboutToHide()));
disconnect(m_menu, &QMenu::aboutToHide, this, &ToolButton::menuAboutToHide);
m_menu = menu;
connect(m_menu, SIGNAL(aboutToHide()), this, SLOT(menuAboutToHide()));
connect(m_menu, &QMenu::aboutToHide, this, &ToolButton::menuAboutToHide);
}
bool ToolButton::showMenuInside() const

View File

@ -24,7 +24,7 @@ TreeWidget::TreeWidget(QWidget* parent)
, m_refreshAllItemsNeeded(true)
, m_showMode(ItemsCollapsed)
{
connect(this, SIGNAL(itemChanged(QTreeWidgetItem*,int)), this, SLOT(sheduleRefresh()));
connect(this, &QTreeWidget::itemChanged, this, &TreeWidget::sheduleRefresh);
}
void TreeWidget::clear()

View File

@ -272,7 +272,7 @@ void WebPage::finished()
if (info.isFile()) {
if (!m_fileWatcher) {
m_fileWatcher = new DelayedFileWatcher(this);
connect(m_fileWatcher, SIGNAL(delayedFileChanged(QString)), this, SLOT(watchedFileChanged(QString)));
connect(m_fileWatcher, &DelayedFileWatcher::delayedFileChanged, this, &WebPage::watchedFileChanged);
}
const QString filePath = url().toLocalFile();
@ -522,7 +522,7 @@ bool WebPage::javaScriptPrompt(const QUrl &securityOrigin, const QString &msg, c
QEventLoop eLoop;
m_runningLoop = &eLoop;
connect(ui->buttonBox, SIGNAL(clicked(QAbstractButton*)), &eLoop, SLOT(quit()));
connect(ui->buttonBox, &QDialogButtonBox::clicked, &eLoop, &QEventLoop::quit);
if (eLoop.exec() == 1) {
return result;
@ -568,7 +568,7 @@ bool WebPage::javaScriptConfirm(const QUrl &securityOrigin, const QString &msg)
QEventLoop eLoop;
m_runningLoop = &eLoop;
connect(ui->buttonBox, SIGNAL(clicked(QAbstractButton*)), &eLoop, SLOT(quit()));
connect(ui->buttonBox, &QDialogButtonBox::clicked, &eLoop, &QEventLoop::quit);
if (eLoop.exec() == 1) {
return false;
@ -623,7 +623,7 @@ void WebPage::javaScriptAlert(const QUrl &securityOrigin, const QString &msg)
QEventLoop eLoop;
m_runningLoop = &eLoop;
connect(ui->buttonBox, SIGNAL(clicked(QAbstractButton*)), &eLoop, SLOT(quit()));
connect(ui->buttonBox, &QDialogButtonBox::clicked, &eLoop, &QEventLoop::quit);
if (eLoop.exec() == 1) {
return;

View File

@ -753,10 +753,10 @@ void WebView::createPageContextMenu(QMenu* menu)
// Special menu for Speed Dial page
if (url().toString() == QL1S("falkon:speeddial")) {
menu->addSeparator();
menu->addAction(QIcon::fromTheme("list-add"), tr("&Add New Page"), this, SLOT(addSpeedDial()));
menu->addAction(IconProvider::settingsIcon(), tr("&Configure Speed Dial"), this, SLOT(configureSpeedDial()));
menu->addAction(QIcon::fromTheme("list-add"), tr("&Add New Page"), this, &WebView::addSpeedDial);
menu->addAction(IconProvider::settingsIcon(), tr("&Configure Speed Dial"), this, &WebView::configureSpeedDial);
menu->addSeparator();
menu->addAction(QIcon::fromTheme(QSL("view-refresh")), tr("Reload All Dials"), this, SLOT(reloadAllSpeedDials()));
menu->addAction(QIcon::fromTheme(QSL("view-refresh")), tr("Reload All Dials"), this, &WebView::reloadAllSpeedDials);
return;
}
@ -775,22 +775,22 @@ void WebView::createPageContextMenu(QMenu* menu)
});
menu->addSeparator();
menu->addAction(QIcon::fromTheme("bookmark-new"), tr("Book&mark page"), this, SLOT(bookmarkLink()));
menu->addAction(QIcon::fromTheme("document-save"), tr("&Save page as..."), this, SLOT(savePageAs()));
menu->addAction(QIcon::fromTheme("edit-copy"), tr("&Copy page link"), this, SLOT(copyLinkToClipboard()))->setData(url());
menu->addAction(QIcon::fromTheme("mail-message-new"), tr("Send page link..."), this, SLOT(sendPageByMail()));
menu->addAction(QIcon::fromTheme("bookmark-new"), tr("Book&mark page"), this, &WebView::bookmarkLink);
menu->addAction(QIcon::fromTheme("document-save"), tr("&Save page as..."), this, &WebView::savePageAs);
menu->addAction(QIcon::fromTheme("edit-copy"), tr("&Copy page link"), this, &WebView::copyLinkToClipboard)->setData(url());
menu->addAction(QIcon::fromTheme("mail-message-new"), tr("Send page link..."), this, &WebView::sendPageByMail);
menu->addSeparator();
menu->addAction(QIcon::fromTheme("edit-select-all"), tr("Select &all"), this, SLOT(editSelectAll()));
menu->addAction(QIcon::fromTheme("edit-select-all"), tr("Select &all"), this, &WebView::editSelectAll);
menu->addSeparator();
const QString scheme = url().scheme();
if (scheme != QL1S("view-source") && WebPage::internalSchemes().contains(scheme)) {
menu->addAction(QIcon::fromTheme("text-html"), tr("Show so&urce code"), this, SLOT(showSource()));
menu->addAction(QIcon::fromTheme("text-html"), tr("Show so&urce code"), this, &WebView::showSource);
}
if (SiteInfo::canShowSiteInfo(url()))
menu->addAction(QIcon::fromTheme("dialog-information"), tr("Show info ab&out site"), this, SLOT(showSiteInfo()));
menu->addAction(QIcon::fromTheme("dialog-information"), tr("Show info ab&out site"), this, &WebView::showSiteInfo);
}
void WebView::createLinkContextMenu(QMenu* menu, const WebHitTestResult &hitTest)
@ -801,17 +801,17 @@ void WebView::createLinkContextMenu(QMenu* menu, const WebHitTestResult &hitTest
connect(act, SIGNAL(triggered()), this, SLOT(userDefinedOpenUrlInNewTab()));
connect(act, SIGNAL(ctrlTriggered()), this, SLOT(userDefinedOpenUrlInBgTab()));
menu->addAction(act);
menu->addAction(IconProvider::newWindowIcon(), tr("Open link in new &window"), this, SLOT(openUrlInNewWindow()))->setData(hitTest.linkUrl());
menu->addAction(IconProvider::newWindowIcon(), tr("Open link in new &window"), this, &WebView::openUrlInNewWindow)->setData(hitTest.linkUrl());
menu->addAction(IconProvider::privateBrowsingIcon(), tr("Open link in &private window"), mApp, SLOT(startPrivateBrowsing()))->setData(hitTest.linkUrl());
menu->addSeparator();
QVariantList bData;
bData << hitTest.linkUrl() << hitTest.linkTitle();
menu->addAction(QIcon::fromTheme("bookmark-new"), tr("B&ookmark link"), this, SLOT(bookmarkLink()))->setData(bData);
menu->addAction(QIcon::fromTheme("bookmark-new"), tr("B&ookmark link"), this, &WebView::bookmarkLink)->setData(bData);
menu->addAction(QIcon::fromTheme("document-save"), tr("&Save link as..."), this, SLOT(downloadLinkToDisk()));
menu->addAction(QIcon::fromTheme("mail-message-new"), tr("Send link..."), this, SLOT(sendTextByMail()))->setData(hitTest.linkUrl().toEncoded());
menu->addAction(QIcon::fromTheme("edit-copy"), tr("&Copy link address"), this, SLOT(copyLinkToClipboard()))->setData(hitTest.linkUrl());
menu->addAction(QIcon::fromTheme("document-save"), tr("&Save link as..."), this, &WebView::downloadLinkToDisk);
menu->addAction(QIcon::fromTheme("mail-message-new"), tr("Send link..."), this, &WebView::sendTextByMail)->setData(hitTest.linkUrl().toEncoded());
menu->addAction(QIcon::fromTheme("edit-copy"), tr("&Copy link address"), this, &WebView::copyLinkToClipboard)->setData(hitTest.linkUrl());
menu->addSeparator();
if (!selectedText().isEmpty()) {
@ -826,15 +826,15 @@ void WebView::createImageContextMenu(QMenu* menu, const WebHitTestResult &hitTes
if (hitTest.imageUrl() != url()) {
Action *act = new Action(tr("Show i&mage"));
act->setData(hitTest.imageUrl());
connect(act, SIGNAL(triggered()), this, SLOT(openActionUrl()));
connect(act, &QAction::triggered, this, &WebView::openActionUrl);
connect(act, SIGNAL(ctrlTriggered()), this, SLOT(userDefinedOpenUrlInNewTab()));
menu->addAction(act);
}
menu->addAction(tr("Copy image"), this, SLOT(copyImageToClipboard()));
menu->addAction(QIcon::fromTheme("edit-copy"), tr("Copy image ad&dress"), this, SLOT(copyLinkToClipboard()))->setData(hitTest.imageUrl());
menu->addAction(tr("Copy image"), this, &WebView::copyImageToClipboard);
menu->addAction(QIcon::fromTheme("edit-copy"), tr("Copy image ad&dress"), this, &WebView::copyLinkToClipboard)->setData(hitTest.imageUrl());
menu->addSeparator();
menu->addAction(QIcon::fromTheme("document-save"), tr("&Save image as..."), this, SLOT(downloadImageToDisk()));
menu->addAction(QIcon::fromTheme("mail-message-new"), tr("Send image..."), this, SLOT(sendTextByMail()))->setData(hitTest.imageUrl().toEncoded());
menu->addAction(QIcon::fromTheme("document-save"), tr("&Save image as..."), this, &WebView::downloadImageToDisk);
menu->addAction(QIcon::fromTheme("mail-message-new"), tr("Send image..."), this, &WebView::sendTextByMail)->setData(hitTest.imageUrl().toEncoded());
menu->addSeparator();
if (!selectedText().isEmpty()) {
@ -853,7 +853,7 @@ void WebView::createSelectedTextContextMenu(QMenu* menu, const WebHitTestResult
if (!menu->actions().contains(pageAction(QWebEnginePage::Copy))) {
menu->addAction(pageAction(QWebEnginePage::Copy));
}
menu->addAction(QIcon::fromTheme("mail-message-new"), tr("Send text..."), this, SLOT(sendTextByMail()))->setData(selectedText);
menu->addAction(QIcon::fromTheme("mail-message-new"), tr("Send text..."), this, &WebView::sendTextByMail)->setData(selectedText);
menu->addSeparator();
// #379: Remove newlines
@ -868,7 +868,7 @@ void WebView::createSelectedTextContextMenu(QMenu* menu, const WebHitTestResult
Action* act = new Action(QIcon::fromTheme("document-open-remote"), tr("Go to &web address"));
act->setData(guessedUrl);
connect(act, SIGNAL(triggered()), this, SLOT(openActionUrl()));
connect(act, &QAction::triggered, this, &WebView::openActionUrl);
connect(act, SIGNAL(ctrlTriggered()), this, SLOT(userDefinedOpenUrlInNewTab()));
menu->addAction(act);
}
@ -880,8 +880,8 @@ void WebView::createSelectedTextContextMenu(QMenu* menu, const WebHitTestResult
SearchEngine engine = mApp->searchEnginesManager()->defaultEngine();
Action* act = new Action(engine.icon, tr("Search \"%1 ..\" with %2").arg(selectedText, engine.name));
connect(act, SIGNAL(triggered()), this, SLOT(searchSelectedText()));
connect(act, SIGNAL(ctrlTriggered()), this, SLOT(searchSelectedTextInBackgroundTab()));
connect(act, &QAction::triggered, this, &WebView::searchSelectedText);
connect(act, &Action::ctrlTriggered, this, &WebView::searchSelectedTextInBackgroundTab);
menu->addAction(act);
// Search with ...
@ -892,8 +892,8 @@ void WebView::createSelectedTextContextMenu(QMenu* menu, const WebHitTestResult
Action* act = new Action(en.icon, en.name);
act->setData(QVariant::fromValue(en));
connect(act, SIGNAL(triggered()), this, SLOT(searchSelectedText()));
connect(act, SIGNAL(ctrlTriggered()), this, SLOT(searchSelectedTextInBackgroundTab()));
connect(act, &QAction::triggered, this, &WebView::searchSelectedText);
connect(act, &Action::ctrlTriggered, this, &WebView::searchSelectedTextInBackgroundTab);
swMenu->addAction(act);
}
@ -906,12 +906,12 @@ void WebView::createMediaContextMenu(QMenu *menu, const WebHitTestResult &hitTes
bool muted = hitTest.mediaMuted();
menu->addSeparator();
menu->addAction(paused ? tr("&Play") : tr("&Pause"), this, SLOT(toggleMediaPause()))->setIcon(QIcon::fromTheme(paused ? "media-playback-start" : "media-playback-pause"));
menu->addAction(muted ? tr("Un&mute") : tr("&Mute"), this, SLOT(toggleMediaMute()))->setIcon(QIcon::fromTheme(muted ? "audio-volume-muted" : "audio-volume-high"));
menu->addAction(paused ? tr("&Play") : tr("&Pause"), this, &WebView::toggleMediaPause)->setIcon(QIcon::fromTheme(paused ? "media-playback-start" : "media-playback-pause"));
menu->addAction(muted ? tr("Un&mute") : tr("&Mute"), this, &WebView::toggleMediaMute)->setIcon(QIcon::fromTheme(muted ? "audio-volume-muted" : "audio-volume-high"));
menu->addSeparator();
menu->addAction(QIcon::fromTheme("edit-copy"), tr("&Copy Media Address"), this, SLOT(copyLinkToClipboard()))->setData(hitTest.mediaUrl());
menu->addAction(QIcon::fromTheme("mail-message-new"), tr("&Send Media Address"), this, SLOT(sendTextByMail()))->setData(hitTest.mediaUrl().toEncoded());
menu->addAction(QIcon::fromTheme("document-save"), tr("Save Media To &Disk"), this, SLOT(downloadMediaToDisk()));
menu->addAction(QIcon::fromTheme("edit-copy"), tr("&Copy Media Address"), this, &WebView::copyLinkToClipboard)->setData(hitTest.mediaUrl());
menu->addAction(QIcon::fromTheme("mail-message-new"), tr("&Send Media Address"), this, &WebView::sendTextByMail)->setData(hitTest.mediaUrl().toEncoded());
menu->addAction(QIcon::fromTheme("document-save"), tr("Save Media To &Disk"), this, &WebView::downloadMediaToDisk);
}
void WebView::checkForForm(QAction *action, const QPoint &pos)

View File

@ -41,17 +41,17 @@ SearchToolBar::SearchToolBar(WebView* view, QWidget* parent)
ui->previous->setShortcut(QKeySequence("Ctrl+Shift+G"));
connect(ui->closeButton, SIGNAL(clicked()), this, SLOT(close()));
connect(ui->lineEdit, SIGNAL(textEdited(QString)), this, SLOT(findNext()));
connect(ui->lineEdit, SIGNAL(returnPressed()), this, SLOT(findNext()));
connect(ui->next, SIGNAL(clicked()), this, SLOT(findNext()));
connect(ui->previous, SIGNAL(clicked()), this, SLOT(findPrevious()));
connect(ui->caseSensitive, SIGNAL(clicked()), this, SLOT(caseSensitivityChanged()));
connect(ui->lineEdit, &QLineEdit::textEdited, this, &SearchToolBar::findNext);
connect(ui->lineEdit, &QLineEdit::returnPressed, this, &SearchToolBar::findNext);
connect(ui->next, &QAbstractButton::clicked, this, &SearchToolBar::findNext);
connect(ui->previous, &QAbstractButton::clicked, this, &SearchToolBar::findPrevious);
connect(ui->caseSensitive, &QAbstractButton::clicked, this, &SearchToolBar::caseSensitivityChanged);
QShortcut* findNextAction = new QShortcut(QKeySequence("F3"), this);
connect(findNextAction, SIGNAL(activated()), this, SLOT(findNext()));
connect(findNextAction, &QShortcut::activated, this, &SearchToolBar::findNext);
QShortcut* findPreviousAction = new QShortcut(QKeySequence("Shift+F3"), this);
connect(findPreviousAction, SIGNAL(activated()), this, SLOT(findPrevious()));
connect(findPreviousAction, &QShortcut::activated, this, &SearchToolBar::findPrevious);
parent->installEventFilter(this);
}

View File

@ -191,7 +191,7 @@ void TabbedWebView::_contextMenuEvent(QContextMenuEvent *event)
if (WebInspector::isEnabled()) {
m_menu->addSeparator();
m_menu->addAction(tr("Inspect Element"), this, SLOT(inspectElement()));
m_menu->addAction(tr("Inspect Element"), this, &TabbedWebView::inspectElement);
}
if (!m_menu->isEmpty()) {

View File

@ -177,8 +177,8 @@ WebTab::WebTab(QWidget *parent)
nlayout->setContentsMargins(0, 0, 0, 0);
nlayout->setSpacing(1);
connect(m_webView, SIGNAL(showNotification(QWidget*)), this, SLOT(showNotification(QWidget*)));
connect(m_webView, SIGNAL(loadFinished(bool)), this, SLOT(loadFinished()));
connect(m_webView, &WebView::showNotification, this, &WebTab::showNotification);
connect(m_webView, &QWebEngineView::loadFinished, this, &WebTab::loadFinished);
connect(m_webView, &TabbedWebView::titleChanged, this, &WebTab::titleWasChanged);
connect(m_webView, &TabbedWebView::titleChanged, this, &WebTab::titleChanged);
connect(m_webView, &TabbedWebView::iconChanged, this, &WebTab::iconChanged);

View File

@ -32,7 +32,7 @@ AutoScrollSettings::AutoScrollSettings(AutoScroller* scroller, QWidget* parent)
ui->iconLabel->setPixmap(QIcon(QStringLiteral(":/autoscroll/data/scroll_all.png")).pixmap(32));
connect(ui->buttonBox, SIGNAL(accepted()), this, SLOT(accepted()));
connect(ui->buttonBox, SIGNAL(rejected()), this, SLOT(close()));
connect(ui->buttonBox, &QDialogButtonBox::rejected, this, &QWidget::close);
}
AutoScrollSettings::~AutoScrollSettings()

View File

@ -30,7 +30,7 @@ FrameScroller::FrameScroller(QObject* parent)
{
m_timer = new QTimer(this);
m_timer->setInterval(10);
connect(m_timer, SIGNAL(timeout()), this, SLOT(scrollStep()));
connect(m_timer, &QTimer::timeout, this, &FrameScroller::scrollStep);
}
void FrameScroller::setPage(WebPage *page)

View File

@ -49,22 +49,22 @@ FCM_Dialog::FCM_Dialog(FCM_Plugin* manager, QWidget* parent)
ui->blackList->setLayoutDirection(Qt::LeftToRight);
}
connect(ui->flashCookieTree, SIGNAL(currentItemChanged(QTreeWidgetItem*,QTreeWidgetItem*)), this, SLOT(currentItemChanged(QTreeWidgetItem*,QTreeWidgetItem*)));
connect(ui->removeAll, SIGNAL(clicked()), this, SLOT(removeAll()));
connect(ui->removeOne, SIGNAL(clicked()), this, SLOT(removeCookie()));
connect(ui->close, SIGNAL(clicked(QAbstractButton*)), this, SLOT(close()));
connect(ui->close2, SIGNAL(clicked(QAbstractButton*)), this, SLOT(close()));
connect(ui->close3, SIGNAL(clicked(QAbstractButton*)), this, SLOT(close()));
connect(ui->search, SIGNAL(textChanged(QString)), this, SLOT(filterString(QString)));
connect(ui->reloadFromDisk, SIGNAL(clicked()), this, SLOT(reloadFromDisk()));
connect(ui->flashCookieTree, &QTreeWidget::currentItemChanged, this, &FCM_Dialog::currentItemChanged);
connect(ui->removeAll, &QAbstractButton::clicked, this, &FCM_Dialog::removeAll);
connect(ui->removeOne, &QAbstractButton::clicked, this, &FCM_Dialog::removeCookie);
connect(ui->close, &QDialogButtonBox::clicked, this, &QWidget::close);
connect(ui->close2, &QDialogButtonBox::clicked, this, &QWidget::close);
connect(ui->close3, &QDialogButtonBox::clicked, this, &QWidget::close);
connect(ui->search, &QLineEdit::textChanged, this, &FCM_Dialog::filterString);
connect(ui->reloadFromDisk, &QAbstractButton::clicked, this, &FCM_Dialog::reloadFromDisk);
connect(ui->whiteAdd, SIGNAL(clicked()), this, SLOT(addWhitelist()));
connect(ui->whiteRemove, SIGNAL(clicked()), this, SLOT(removeWhitelist()));
connect(ui->whiteRemove, &QAbstractButton::clicked, this, &FCM_Dialog::removeWhitelist);
connect(ui->blackAdd, SIGNAL(clicked()), this, SLOT(addBlacklist()));
connect(ui->blackRemove, SIGNAL(clicked()), this, SLOT(removeBlacklist()));
connect(ui->blackRemove, &QAbstractButton::clicked, this, &FCM_Dialog::removeBlacklist);
connect(ui->autoMode, SIGNAL(toggled(bool)), ui->notification, SLOT(setEnabled(bool)));
connect(ui->autoMode, SIGNAL(toggled(bool)), ui->labelNotification, SLOT(setEnabled(bool)));
connect(ui->autoMode, &QAbstractButton::toggled, ui->notification, &QWidget::setEnabled);
connect(ui->autoMode, &QAbstractButton::toggled, ui->labelNotification, &QWidget::setEnabled);
ui->autoMode->setChecked(m_manager->readSettings().value(QL1S("autoMode")).toBool());
ui->notification->setEnabled(m_manager->readSettings().value(QL1S("autoMode")).toBool());
@ -80,10 +80,10 @@ FCM_Dialog::FCM_Dialog(FCM_Plugin* manager, QWidget* parent)
ui->flashCookieTree->setFocus();
ui->flashCookieTree->setContextMenuPolicy(Qt::CustomContextMenu);
connect(ui->flashCookieTree, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(cookieTreeContextMenuRequested(QPoint)));
connect(ui->flashCookieTree, &QWidget::customContextMenuRequested, this, &FCM_Dialog::cookieTreeContextMenuRequested);
QShortcut* removeShortcut = new QShortcut(QKeySequence("Del"), this);
connect(removeShortcut, SIGNAL(activated()), this, SLOT(deletePressed()));
connect(removeShortcut, &QShortcut::activated, this, &FCM_Dialog::deletePressed);
QzTools::setWmClass("FlashCookies", this);
}
@ -180,18 +180,18 @@ void FCM_Dialog::currentItemChanged(QTreeWidgetItem* current, QTreeWidgetItem* p
void FCM_Dialog::refreshView(bool forceReload)
{
disconnect(ui->search, SIGNAL(textChanged(QString)), this, SLOT(filterString(QString)));
disconnect(ui->search, &QLineEdit::textChanged, this, &FCM_Dialog::filterString);
ui->search->clear();
ui->textEdit->clear();
connect(ui->search, SIGNAL(textChanged(QString)), this, SLOT(filterString(QString)));
connect(ui->search, &QLineEdit::textChanged, this, &FCM_Dialog::filterString);
if (forceReload) {
m_manager->clearCache();
m_manager->clearNewOrigins();
}
QTimer::singleShot(0, this, SLOT(refreshFlashCookiesTree()));
QTimer::singleShot(0, this, SLOT(refreshFilters()));
QTimer::singleShot(0, this, &FCM_Dialog::refreshFlashCookiesTree);
QTimer::singleShot(0, this, &FCM_Dialog::refreshFilters);
}
void FCM_Dialog::showPage(int index)

View File

@ -74,12 +74,12 @@ void FCM_Plugin::init(InitState state, const QString &settingsPath)
{
m_settingsPath = settingsPath;
connect(mApp->plugins(), SIGNAL(mainWindowCreated(BrowserWindow*)), this, SLOT(mainWindowCreated(BrowserWindow*)));
connect(mApp->plugins(), SIGNAL(mainWindowDeleted(BrowserWindow*)), this, SLOT(mainWindowDeleted(BrowserWindow*)));
connect(mApp->plugins(), &PluginProxy::mainWindowCreated, this, &FCM_Plugin::mainWindowCreated);
connect(mApp->plugins(), &PluginProxy::mainWindowDeleted, this, &FCM_Plugin::mainWindowDeleted);
m_timer = new QTimer(this);
m_timer->setInterval(refreshInterval);
connect(m_timer, SIGNAL(timeout()), this, SLOT(autoRefresh()));
connect(m_timer, &QTimer::timeout, this, &FCM_Plugin::autoRefresh);
// start timer if needed
startStopTimer();
@ -130,7 +130,7 @@ void FCM_Plugin::showSettings(QWidget* parent)
void FCM_Plugin::populateExtensionsMenu(QMenu* menu)
{
QAction* showFCM = new QAction(QIcon(":/flashcookiemanager/data/flash-cookie-manager.png"), tr("Flash Cookie Manager"), menu);
connect(showFCM, SIGNAL(triggered()), this, SLOT(showFlashCookieManager()));
connect(showFCM, &QAction::triggered, this, &FCM_Plugin::showFlashCookieManager);
menu->addAction(showFCM);
}

View File

@ -57,7 +57,7 @@ GM_AddScriptDialog::GM_AddScriptDialog(GM_Manager* manager, GM_Script* script, Q
QString scriptInfo = QString("<b>%1</b> %2<br/>%3 %4 %5").arg(script->name(), script->version(), script->description(), runsAt, dontRunsAt);
ui->textBrowser->setText(scriptInfo);
connect(ui->showSource, SIGNAL(clicked()), this, SLOT(showSource()));
connect(ui->showSource, &QAbstractButton::clicked, this, &GM_AddScriptDialog::showSource);
connect(this, SIGNAL(accepted()), this, SLOT(accepted()));
}

Some files were not shown because too many files have changed in this diff Show More