1
mirror of https://invent.kde.org/network/falkon.git synced 2024-09-21 09:42:10 +02:00

Use Q_EMIT/nullptr/fix gcc warning

This commit is contained in:
Laurent Montel 2022-06-27 19:13:24 +02:00
parent 54e8e80cc3
commit 424340e392
99 changed files with 344 additions and 348 deletions

View File

@ -348,7 +348,7 @@ void FancyTabBar::setTabToolTip(int index, const QString &toolTip)
// mode itself
void FancyTabBar::emitCurrentIndex()
{
emit currentChanged(m_currentIndex);
Q_EMIT currentChanged(m_currentIndex);
}
void FancyTabBar::mousePressEvent(QMouseEvent* e)
@ -460,7 +460,7 @@ void FancyTabBar::setCurrentIndex(int index)
{
m_currentIndex = index;
update();
emit currentChanged(m_currentIndex);
Q_EMIT currentChanged(m_currentIndex);
}
@ -590,7 +590,7 @@ void FancyTabWidget::SetCurrentIndex(int index)
void FancyTabWidget::ShowWidget(int index)
{
stack_->setCurrentIndex(index);
emit CurrentChanged(index);
Q_EMIT CurrentChanged(index);
}
void FancyTabWidget::AddBottomWidget(QWidget* widget)
@ -656,7 +656,7 @@ void FancyTabWidget::SetMode(Mode mode)
tab_bar_->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred);
mode_ = mode;
emit ModeChanged(mode);
Q_EMIT ModeChanged(mode);
update();
}

View File

@ -38,7 +38,7 @@ bool SideWidget::event(QEvent* event)
{
switch (event->type()) {
case QEvent::LayoutRequest:
emit sizeHintChanged();
Q_EMIT sizeHintChanged();
break;
case QEvent::MouseButtonPress:

View File

@ -275,7 +275,7 @@ void QtLocalPeer::receiveConnection()
socket->waitForBytesWritten(1000);
socket->waitForDisconnected(1000); // make sure client reads ack
delete socket;
emit messageReceived(message); //### (might take a long time to return)
Q_EMIT messageReceived(message); //### (might take a long time to return)
#endif
}

View File

@ -250,7 +250,7 @@ void QtSingleApplication::setAppId(const QString &id)
/*!
Tries to send the text \a message to the currently running
instance. The QtSingleApplication object in the running instance
will emit the messageReceived() signal when it receives the
will Q_EMIT the messageReceived() signal when it receives the
message.
This function returns true if the message has been sent to, and

View File

@ -75,7 +75,7 @@ void AdBlockManager::setEnabled(bool enabled)
}
m_enabled = enabled;
emit enabledChanged(enabled);
Q_EMIT enabledChanged(enabled);
Settings settings;
settings.beginGroup(QSL("AdBlock"));
@ -144,7 +144,7 @@ QVector<AdBlockedRequest> AdBlockManager::blockedRequestsForUrl(const QUrl &url)
void AdBlockManager::clearBlockedRequestsForUrl(const QUrl &url)
{
if (m_blockedRequests.remove(url)) {
emit blockedRequestsChanged(url);
Q_EMIT blockedRequestsChanged(url);
}
}
@ -350,7 +350,7 @@ void AdBlockManager::load()
connect(m_interceptor, &AdBlockUrlInterceptor::requestBlocked, this, [this](const AdBlockedRequest &request) {
m_blockedRequests[request.firstPartyUrl].append(request);
emit blockedRequestsChanged(request.firstPartyUrl);
Q_EMIT blockedRequestsChanged(request.firstPartyUrl);
});
mApp->networkManager()->installUrlInterceptor(m_interceptor);

View File

@ -170,14 +170,14 @@ void AdBlockSubscription::subscriptionDownloaded()
m_reply = 0;
if (error) {
emit subscriptionError(tr("Cannot load subscription!"));
Q_EMIT subscriptionError(tr("Cannot load subscription!"));
return;
}
loadSubscription(AdBlockManager::instance()->disabledRules());
emit subscriptionUpdated();
emit subscriptionChanged();
Q_EMIT subscriptionUpdated();
Q_EMIT subscriptionChanged();
}
bool AdBlockSubscription::saveDownloadedData(const QByteArray &data)
@ -220,7 +220,7 @@ const AdBlockRule* AdBlockSubscription::enableRule(int offset)
rule->setEnabled(true);
AdBlockManager::instance()->removeDisabledRule(rule->filter());
emit subscriptionChanged();
Q_EMIT subscriptionChanged();
if (rule->isCssRule())
mApp->reloadUserStyleSheet();
@ -238,7 +238,7 @@ const AdBlockRule* AdBlockSubscription::disableRule(int offset)
rule->setEnabled(false);
AdBlockManager::instance()->addDisabledRule(rule->filter());
emit subscriptionChanged();
Q_EMIT subscriptionChanged();
if (rule->isCssRule())
mApp->reloadUserStyleSheet();
@ -379,7 +379,7 @@ int AdBlockCustomList::addRule(AdBlockRule* rule)
{
m_rules.append(rule);
emit subscriptionChanged();
Q_EMIT subscriptionChanged();
if (rule->isCssRule())
mApp->reloadUserStyleSheet();
@ -398,7 +398,7 @@ bool AdBlockCustomList::removeRule(int offset)
m_rules.remove(offset);
emit subscriptionChanged();
Q_EMIT subscriptionChanged();
if (rule->isCssRule())
mApp->reloadUserStyleSheet();
@ -418,7 +418,7 @@ const AdBlockRule* AdBlockCustomList::replaceRule(AdBlockRule* rule, int offset)
AdBlockRule* oldRule = m_rules.at(offset);
m_rules[offset] = rule;
emit subscriptionChanged();
Q_EMIT subscriptionChanged();
if (rule->isCssRule() || oldRule->isCssRule())
mApp->reloadUserStyleSheet();

View File

@ -56,5 +56,5 @@ void AdBlockUrlInterceptor::interceptRequest(QWebEngineUrlRequestInfo &request)
r.resourceType = request.resourceType();
r.navigationType = request.navigationType();
r.rule = ruleFilter;
emit requestBlocked(r);
Q_EMIT requestBlocked(r);
}

View File

@ -32,7 +32,7 @@ void AutoSaver::saveIfNecessary()
{
if (m_timer.isActive()) {
m_timer.stop();
emit save();
Q_EMIT save();
}
}
@ -47,7 +47,7 @@ void AutoSaver::timerEvent(QTimerEvent* event)
{
if (event->timerId() == m_timer.timerId()) {
m_timer.stop();
emit save();
Q_EMIT save();
}
QObject::timerEvent(event);

View File

@ -327,7 +327,7 @@ void BrowserWindow::postLaunch()
}
mApp->plugins()->emitMainWindowCreated(this);
emit startingCompleted();
Q_EMIT startingCompleted();
raise();
activateWindow();
@ -1515,7 +1515,7 @@ void BrowserWindow::closeEvent(QCloseEvent* event)
}
}
emit aboutToClose();
Q_EMIT aboutToClose();
saveSettings();
mApp->closedWindowsManager()->saveWindow(this);

View File

@ -161,7 +161,7 @@ public Q_SLOTS:
void bookmarkPage();
void bookmarkAllTabs();
void loadAddress(const QUrl &url);
void showSource(WebView *view = Q_NULLPTR);
void showSource(WebView *view = nullptr);
private Q_SLOTS:
void openLocation();

View File

@ -509,7 +509,7 @@ void MainApplication::destroyRestoreManager()
void MainApplication::reloadSettings()
{
loadSettings();
emit settingsReloaded();
Q_EMIT settingsReloaded();
}
QString MainApplication::styleName() const
@ -723,7 +723,7 @@ void MainApplication::quitApplication()
}
for (BrowserWindow *window : qAsConst(m_windows)) {
emit window->aboutToClose();
Q_EMIT window->aboutToClose();
}
if (m_sessionManager && m_windows.count() > 0) {
@ -914,7 +914,7 @@ void MainApplication::onFocusChanged()
if (activeBrowserWindow) {
m_lastActiveWindow = activeBrowserWindow;
emit activeWindowChanged(m_lastActiveWindow);
Q_EMIT activeWindowChanged(m_lastActiveWindow);
}
}

View File

@ -163,7 +163,7 @@ void PasswordManager::switchBackend(const QString &backendID)
settings.setValue(QSL("Backend"), backendID);
settings.endGroup();
emit passwordBackendChanged();
Q_EMIT passwordBackendChanged();
}
bool PasswordManager::registerBackend(const QString &id, PasswordBackend* backend)

View File

@ -148,7 +148,7 @@ void Bookmarks::insertBookmark(BookmarkItem* parent, int row, BookmarkItem* item
m_lastFolder = parent;
m_model->addBookmark(parent, row, item);
emit bookmarkAdded(item);
Q_EMIT bookmarkAdded(item);
m_autoSaver->changeOccurred();
}
@ -160,7 +160,7 @@ bool Bookmarks::removeBookmark(BookmarkItem* item)
}
m_model->removeBookmark(item);
emit bookmarkRemoved(item);
Q_EMIT bookmarkRemoved(item);
m_autoSaver->changeOccurred();
return true;
@ -169,7 +169,7 @@ bool Bookmarks::removeBookmark(BookmarkItem* item)
void Bookmarks::changeBookmark(BookmarkItem* item)
{
Q_ASSERT(item);
emit bookmarkChanged(item);
Q_EMIT bookmarkChanged(item);
m_autoSaver->changeOccurred();
}
@ -177,14 +177,14 @@ void Bookmarks::changeBookmark(BookmarkItem* item)
void Bookmarks::setShowOnlyIconsInToolbar(bool state)
{
m_showOnlyIconsInToolbar = state;
emit showOnlyIconsInToolbarChanged(state);
Q_EMIT showOnlyIconsInToolbarChanged(state);
m_autoSaver->changeOccurred();
}
void Bookmarks::setShowOnlyTextInToolbar(bool state)
{
m_showOnlyTextInToolbar = state;
emit showOnlyTextInToolbarChanged(state);
Q_EMIT showOnlyTextInToolbarChanged(state);
m_autoSaver->changeOccurred();
}

View File

@ -305,7 +305,7 @@ BookmarkItem* BookmarksModel::item(const QModelIndex &index) const
void BookmarksModel::bookmarkChanged(BookmarkItem* item)
{
QModelIndex idx = index(item);
emit dataChanged(idx, idx);
Q_EMIT dataChanged(idx, idx);
}

View File

@ -54,7 +54,7 @@ void BookmarksFoldersMenu::folderChoosed()
{
if (auto* act = qobject_cast<QAction*>(sender())) {
BookmarkItem* folder = static_cast<BookmarkItem*>(act->data().value<void*>());
emit folderSelected(folder);
Q_EMIT folderSelected(folder);
}
}
@ -115,7 +115,7 @@ void BookmarksFoldersButton::setSelectedFolder(BookmarkItem* folder)
setIcon(folder->icon());
if (sender()) {
emit selectedFolderChanged(folder);
Q_EMIT selectedFolderChanged(folder);
}
}

View File

@ -173,12 +173,12 @@ void BookmarksTreeView::selectionChanged(const QItemSelection &selected, const Q
Q_UNUSED(selected)
Q_UNUSED(deselected)
emit bookmarksSelected(selectedBookmarks());
Q_EMIT bookmarksSelected(selectedBookmarks());
}
void BookmarksTreeView::contextMenuEvent(QContextMenuEvent* event)
{
emit contextMenuRequested(viewport()->mapToGlobal(event->pos()));
Q_EMIT contextMenuRequested(viewport()->mapToGlobal(event->pos()));
}
void BookmarksTreeView::mouseMoveEvent(QMouseEvent* event)
@ -210,10 +210,10 @@ void BookmarksTreeView::mousePressEvent(QMouseEvent* event)
BookmarkItem* item = m_model->item(m_filter->mapToSource(index));
if (buttons == Qt::LeftButton && modifiers == Qt::ShiftModifier) {
emit bookmarkShiftActivated(item);
Q_EMIT bookmarkShiftActivated(item);
}
else if (buttons == Qt::MiddleButton || (buttons == Qt::LeftButton && modifiers == Qt::ControlModifier)) {
emit bookmarkCtrlActivated(item);
Q_EMIT bookmarkCtrlActivated(item);
}
}
}
@ -231,7 +231,7 @@ void BookmarksTreeView::mouseReleaseEvent(QMouseEvent* event)
// Activate bookmarks with single mouse click in Sidebar
if (m_type == BookmarksSidebarViewType && event->button() == Qt::LeftButton && event->modifiers() == Qt::NoModifier) {
emit bookmarkActivated(item);
Q_EMIT bookmarkActivated(item);
}
}
}
@ -250,10 +250,10 @@ void BookmarksTreeView::mouseDoubleClickEvent(QMouseEvent* event)
Qt::KeyboardModifiers modifiers = QApplication::keyboardModifiers();
if (buttons == Qt::LeftButton && modifiers == Qt::NoModifier) {
emit bookmarkActivated(item);
Q_EMIT bookmarkActivated(item);
}
else if (buttons == Qt::LeftButton && modifiers == Qt::ShiftModifier) {
emit bookmarkShiftActivated(item);
Q_EMIT bookmarkShiftActivated(item);
}
}
}
@ -277,13 +277,13 @@ void BookmarksTreeView::keyPressEvent(QKeyEvent* event)
Qt::KeyboardModifiers modifiers = event->modifiers();
if (modifiers == Qt::NoModifier || modifiers == Qt::KeypadModifier) {
emit bookmarkActivated(item);
Q_EMIT bookmarkActivated(item);
}
else if (modifiers == Qt::ControlModifier) {
emit bookmarkCtrlActivated(item);
Q_EMIT bookmarkCtrlActivated(item);
}
else if (modifiers == Qt::ShiftModifier) {
emit bookmarkShiftActivated(item);
Q_EMIT bookmarkShiftActivated(item);
}
}
break;

View File

@ -123,13 +123,13 @@ void CookieJar::slotCookieAdded(const QNetworkCookie &cookie)
}
m_cookies.append(cookie);
emit cookieAdded(cookie);
Q_EMIT cookieAdded(cookie);
}
void CookieJar::slotCookieRemoved(const QNetworkCookie &cookie)
{
if (m_cookies.removeOne(cookie))
emit cookieRemoved(cookie);
Q_EMIT cookieRemoved(cookie);
}
bool CookieJar::cookieFilter(const QWebEngineCookieStore::FilterRequest &request) const

View File

@ -243,7 +243,7 @@ QTreeWidgetItem *CookieManager::cookieItem(const QNetworkCookie &cookie) const
if (it.value() == cookie)
return it.key();
}
return Q_NULLPTR;
return nullptr;
}
void CookieManager::removeBlacklist()
@ -320,7 +320,7 @@ void CookieManager::removeCookie(const QNetworkCookie &cookie)
if (item->parent() && item->parent()->childCount() == 1) {
m_domainHash.remove(cookieDomain(cookie));
delete item->parent();
item = Q_NULLPTR;
item = nullptr;
}
delete item;

View File

@ -151,7 +151,7 @@ void DownloadItem::finished()
if (success && m_openFile)
openFile();
emit downloadFinished(true);
Q_EMIT downloadFinished(true);
}
void DownloadItem::downloadProgress(qint64 received, qint64 total)
@ -276,7 +276,7 @@ void DownloadItem::stop()
m_download->cancel();
m_downloading = false;
emit downloadFinished(false);
Q_EMIT downloadFinished(false);
}
void DownloadItem::pauseResume()
@ -329,7 +329,7 @@ void DownloadItem::copyDownloadLink()
void DownloadItem::clear()
{
emit deleteItem(this);
Q_EMIT deleteItem(this);
}
void DownloadItem::openFile()

View File

@ -106,7 +106,7 @@ void DownloadManager::show()
void DownloadManager::resizeEvent(QResizeEvent* e)
{
QWidget::resizeEvent(e);
emit resized(size());
Q_EMIT resized(size());
}
void DownloadManager::keyPressEvent(QKeyEvent* e)
@ -251,7 +251,7 @@ void DownloadManager::clearList()
items.append(downItem);
}
qDeleteAll(items);
emit downloadsCountChanged();
Q_EMIT downloadsCountChanged();
}
void DownloadManager::download(QWebEngineDownloadItem *downloadItem)
@ -372,7 +372,7 @@ void DownloadManager::download(QWebEngineDownloadItem *downloadItem)
downItem->show();
m_activeDownloadsCount++;
emit downloadsCountChanged();
Q_EMIT downloadsCountChanged();
}
int DownloadManager::downloadsCount() const
@ -403,7 +403,7 @@ void DownloadManager::downloadFinished(bool success)
downloadingAllFilesFinished = false;
}
emit downloadsCountChanged();
Q_EMIT downloadsCountChanged();
if (downloadingAllFilesFinished) {
if (success && qApp->activeWindow() != this) {

View File

@ -127,13 +127,13 @@ void DownloadOptionsDialog::emitDialogFinished(int status)
}
m_signalEmited = true;
emit dialogFinished(status);
Q_EMIT dialogFinished(status);
}
DownloadOptionsDialog::~DownloadOptionsDialog()
{
if (!m_signalEmited) {
emit dialogFinished(-1);
Q_EMIT dialogFinished(-1);
}
delete ui;

View File

@ -98,7 +98,7 @@ void History::addHistoryEntry(const QUrl &url, QString title)
entry.url = url;
entry.urlString = url.toEncoded();
entry.title = title;
emit historyEntryAdded(entry);
Q_EMIT historyEntryAdded(entry);
});
job->start();
} else {
@ -126,7 +126,7 @@ void History::addHistoryEntry(const QUrl &url, QString title)
after.date = QDateTime::currentDateTime();
after.title = title;
emit historyEntryEdited(before, after);
Q_EMIT historyEntryEdited(before, after);
});
job->start();
}
@ -174,7 +174,7 @@ void History::deleteHistoryEntry(const QList<int> &list)
query.addBindValue(entry.url.toEncoded(QUrl::RemoveFragment));
query.exec();
emit historyEntryDeleted(entry);
Q_EMIT historyEntryDeleted(entry);
}
db.commit();
@ -252,7 +252,7 @@ void History::clearHistory()
mApp->webProfile()->clearAllVisitedLinks();
emit resetHistory();
Q_EMIT resetHistory();
}
void History::setSaving(bool state)

View File

@ -148,7 +148,7 @@ bool HistoryModel::setData(const QModelIndex &index, const QVariant &value, int
if (role == IconRole) {
item->setIcon(value.value<QIcon>());
emit dataChanged(index, index);
Q_EMIT dataChanged(index, index);
return true;
}
@ -186,7 +186,7 @@ QModelIndex HistoryModel::parent(const QModelIndex &index) const
Qt::ItemFlags HistoryModel::flags(const QModelIndex &index) const
{
if (!index.isValid()) {
return 0;
return Qt::NoItemFlags;
}
return Qt::ItemIsEnabled | Qt::ItemIsSelectable;
@ -535,7 +535,7 @@ void HistoryFilterModel::setFilterFixedString(const QString &pattern)
void HistoryFilterModel::startFiltering()
{
if (m_pattern.isEmpty()) {
emit collapseAllItems();
Q_EMIT collapseAllItems();
QSortFilterProxyModel::setFilterFixedString(m_pattern);
return;
}
@ -543,7 +543,7 @@ void HistoryFilterModel::startFiltering()
QApplication::setOverrideCursor(Qt::WaitCursor);
// Expand all items also calls fetchmore
emit expandAllItems();
Q_EMIT expandAllItems();
QSortFilterProxyModel::setFilterFixedString(m_pattern);

View File

@ -135,7 +135,7 @@ void HistoryTreeView::removeSelectedItems()
void HistoryTreeView::contextMenuEvent(QContextMenuEvent* event)
{
emit contextMenuRequested(viewport()->mapToGlobal(event->pos()));
Q_EMIT contextMenuRequested(viewport()->mapToGlobal(event->pos()));
}
void HistoryTreeView::mouseMoveEvent(QMouseEvent* event)
@ -167,10 +167,10 @@ void HistoryTreeView::mousePressEvent(QMouseEvent* event)
const QUrl url = index.data(HistoryModel::UrlRole).toUrl();
if (buttons == Qt::LeftButton && modifiers == Qt::ShiftModifier) {
emit urlShiftActivated(url);
Q_EMIT urlShiftActivated(url);
}
else if (buttons == Qt::MiddleButton || (buttons == Qt::LeftButton && modifiers == Qt::ControlModifier)) {
emit urlCtrlActivated(url);
Q_EMIT urlCtrlActivated(url);
}
}
}
@ -188,7 +188,7 @@ void HistoryTreeView::mouseReleaseEvent(QMouseEvent* event)
// Activate urls with single mouse click in Sidebar
if (m_type == HistorySidebarViewType && event->button() == Qt::LeftButton && event->modifiers() == Qt::NoModifier) {
emit urlActivated(url);
Q_EMIT urlActivated(url);
}
}
}
@ -207,10 +207,10 @@ void HistoryTreeView::mouseDoubleClickEvent(QMouseEvent* event)
Qt::KeyboardModifiers modifiers = QApplication::keyboardModifiers();
if (buttons == Qt::LeftButton && modifiers == Qt::NoModifier) {
emit urlActivated(url);
Q_EMIT urlActivated(url);
}
else if (buttons == Qt::LeftButton && modifiers == Qt::ShiftModifier) {
emit urlShiftActivated(url);
Q_EMIT urlShiftActivated(url);
}
}
}
@ -235,13 +235,13 @@ void HistoryTreeView::keyPressEvent(QKeyEvent* event)
Qt::KeyboardModifiers modifiers = event->modifiers();
if (modifiers == Qt::NoModifier || modifiers == Qt::KeypadModifier) {
emit urlActivated(url);
Q_EMIT urlActivated(url);
}
else if (modifiers == Qt::ControlModifier) {
emit urlCtrlActivated(url);
Q_EMIT urlCtrlActivated(url);
}
else if (modifiers == Qt::ShiftModifier) {
emit urlShiftActivated(url);
Q_EMIT urlShiftActivated(url);
}
}
break;

View File

@ -79,7 +79,7 @@ void LocationCompleter::complete(const QString &string)
// Eg. popup was not closed yet this completion session
m_popupClosed = false;
emit cancelRefreshJob();
Q_EMIT cancelRefreshJob();
auto* job = new LocationCompleterRefreshJob(trimmedStr);
connect(job, &LocationCompleterRefreshJob::finished, this, &LocationCompleter::refreshJobFinished);
@ -151,7 +151,7 @@ void LocationCompleter::refreshJobFinished()
}
if (qzSettings->useInlineCompletion) {
emit showDomainCompletion(job->domainCompletion());
Q_EMIT showDomainCompletion(job->domainCompletion());
}
s_model->setData(s_model->index(0, 0), m_locationBar->text(), LocationCompleterModel::SearchStringRole);
@ -174,7 +174,7 @@ void LocationCompleter::slotPopupClosed()
disconnect(s_view, &LocationCompleterView::searchEnginesDialogRequested, this, &LocationCompleter::openSearchEnginesDialog);
disconnect(s_view->selectionModel(), &QItemSelectionModel::currentChanged, this, &LocationCompleter::currentChanged);
emit popupClosed();
Q_EMIT popupClosed();
}
void LocationCompleter::addSuggestions(const QStringList &suggestions)
@ -229,7 +229,7 @@ void LocationCompleter::currentChanged(const QModelIndex &index)
completion = originalText;
}
emit showCompletion(completion, completeDomain);
Q_EMIT showCompletion(completion, completeDomain);
}
void LocationCompleter::indexActivated(const QModelIndex &index)
@ -239,7 +239,7 @@ void LocationCompleter::indexActivated(const QModelIndex &index)
closePopup();
// Clear locationbar
emit clearCompletion();
Q_EMIT clearCompletion();
bool ok;
const int tabPos = index.data(LocationCompleterModel::TabPositionTabRole).toInt(&ok);
@ -263,7 +263,7 @@ void LocationCompleter::indexCtrlActivated(const QModelIndex &index)
closePopup();
// Clear locationbar
emit clearCompletion();
Q_EMIT clearCompletion();
// Load request in new tab
m_window->tabWidget()->addView(createLoadRequest(index), Qz::NT_CleanSelectedTab);
@ -276,7 +276,7 @@ void LocationCompleter::indexShiftActivated(const QModelIndex &index)
closePopup();
// Clear locationbar
emit clearCompletion();
Q_EMIT clearCompletion();
// Load request
if (index.data(LocationCompleterModel::VisitSearchItemRole).toBool()) {
@ -367,16 +367,16 @@ void LocationCompleter::loadRequest(const LoadRequest &request)
closePopup();
// Show url in locationbar
emit showCompletion(request.url().toString(), false);
Q_EMIT showCompletion(request.url().toString(), false);
// Load request
emit loadRequested(request);
Q_EMIT loadRequested(request);
}
void LocationCompleter::openSearchEnginesDialog()
{
// Clear locationbar
emit clearCompletion();
Q_EMIT clearCompletion();
auto *dialog = new SearchEnginesDialog(m_window);
dialog->open();

View File

@ -76,7 +76,7 @@ void LocationCompleterRefreshJob::jobCancelled()
void LocationCompleterRefreshJob::slotFinished()
{
emit finished();
Q_EMIT finished();
}
static bool countBiggerThan(const QStandardItem* i1, const QStandardItem* i2)

View File

@ -170,17 +170,17 @@ bool LocationCompleterView::eventFilter(QObject* object, QEvent* event)
Qt::KeyboardModifiers modifiers = e->modifiers();
if (button == Qt::LeftButton && modifiers == Qt::NoModifier) {
emit indexActivated(idx);
Q_EMIT indexActivated(idx);
return true;
}
if (button == Qt::MiddleButton || (button == Qt::LeftButton && modifiers == Qt::ControlModifier)) {
emit indexCtrlActivated(idx);
Q_EMIT indexCtrlActivated(idx);
return true;
}
if (button == Qt::LeftButton && modifiers == Qt::ShiftModifier) {
emit indexShiftActivated(idx);
Q_EMIT indexShiftActivated(idx);
return true;
}
}
@ -206,17 +206,17 @@ bool LocationCompleterView::eventFilter(QObject* object, QEvent* event)
}
if (modifiers == Qt::NoModifier || modifiers == Qt::KeypadModifier) {
emit indexActivated(idx);
Q_EMIT indexActivated(idx);
return true;
}
if (modifiers == Qt::ControlModifier) {
emit indexCtrlActivated(idx);
Q_EMIT indexCtrlActivated(idx);
return true;
}
if (modifiers == Qt::ShiftModifier) {
emit indexShiftActivated(idx);
Q_EMIT indexShiftActivated(idx);
return true;
}
break;
@ -304,7 +304,7 @@ bool LocationCompleterView::eventFilter(QObject* object, QEvent* event)
case Qt::Key_Delete:
if (idx != visitSearchIdx && m_view->viewport()->rect().contains(m_view->visualRect(idx))) {
emit indexDeleteRequested(idx);
Q_EMIT indexDeleteRequested(idx);
return true;
}
break;
@ -372,7 +372,7 @@ void LocationCompleterView::close()
m_delegate->setForceVisitItem(false);
m_forceResize = true;
emit closed();
Q_EMIT closed();
}
void LocationCompleterView::setupSearchEngines()
@ -390,7 +390,7 @@ void LocationCompleterView::setupSearchEngines()
button->setIconSize(QSize(16, 16));
connect(button, &ToolButton::clicked, this, [=]() {
const QString text = model()->index(0, 0).data(LocationCompleterModel::SearchStringRole).toString();
emit loadRequested(mApp->searchEnginesManager()->searchResult(engine, text));
Q_EMIT loadRequested(mApp->searchEnginesManager()->searchResult(engine, text));
});
m_searchEnginesLayout->addWidget(button);
}

View File

@ -506,7 +506,7 @@ void NavigationBar::toolActionActivated()
buttonTools->setDown(false);
delete c;
};
emit data.button->clicked(c);
Q_EMIT data.button->clicked(c);
if (c->popupOpened) {
buttonTools->setDown(true);
} else {

View File

@ -71,7 +71,7 @@ void NavigationBarToolButton::clicked()
setDown(false);
delete c;
};
emit m_button->clicked(c);
Q_EMIT m_button->clicked(c);
if (c->popupOpened) {
setDown(true);
} else {

View File

@ -70,7 +70,7 @@ void ReloadStopButton::updateButton()
void ReloadStopButton::buttonClicked()
{
if (m_loadInProgress)
emit stopClicked();
Q_EMIT stopClicked();
else
emit reloadClicked();
Q_EMIT reloadClicked();
}

View File

@ -33,11 +33,11 @@ class FALKON_EXPORT NetworkManager : public QNetworkAccessManager
Q_OBJECT
public:
explicit NetworkManager(QObject *parent = Q_NULLPTR);
explicit NetworkManager(QObject *parent = nullptr);
bool certificateError(const QWebEngineCertificateError &error, QWidget *parent = Q_NULLPTR);
void authentication(const QUrl &url, QAuthenticator *auth, QWidget *parent = Q_NULLPTR);
void proxyAuthentication(const QString &proxyHost, QAuthenticator *auth, QWidget *parent = Q_NULLPTR);
bool certificateError(const QWebEngineCertificateError &error, QWidget *parent = nullptr);
void authentication(const QUrl &url, QAuthenticator *auth, QWidget *parent = nullptr);
void proxyAuthentication(const QString &proxyHost, QAuthenticator *auth, QWidget *parent = nullptr);
void installUrlInterceptor(UrlInterceptor *interceptor);
void removeUrlInterceptor(UrlInterceptor *interceptor);

View File

@ -29,7 +29,7 @@ class UrlInterceptor;
class FALKON_EXPORT NetworkUrlInterceptor : public QWebEngineUrlRequestInterceptor
{
public:
explicit NetworkUrlInterceptor(QObject* parent = Q_NULLPTR);
explicit NetworkUrlInterceptor(QObject* parent = nullptr);
void interceptRequest(QWebEngineUrlRequestInfo &info) Q_DECL_OVERRIDE;

View File

@ -115,7 +115,7 @@ void FalkonSchemeReply::loadPage()
m_buffer.open(QIODevice::ReadOnly);
lock.unlock();
emit readyRead();
Q_EMIT readyRead();
m_loaded = true;
}

View File

@ -28,7 +28,7 @@
class FALKON_EXPORT FalkonSchemeHandler : public QWebEngineUrlSchemeHandler
{
public:
explicit FalkonSchemeHandler(QObject *parent = Q_NULLPTR);
explicit FalkonSchemeHandler(QObject *parent = nullptr);
void requestStarted(QWebEngineUrlRequestJob *job) Q_DECL_OVERRIDE;
@ -41,7 +41,7 @@ class FALKON_EXPORT FalkonSchemeReply : public QIODevice
Q_OBJECT
public:
explicit FalkonSchemeReply(QWebEngineUrlRequestJob *job, QObject *parent = Q_NULLPTR);
explicit FalkonSchemeReply(QWebEngineUrlRequestJob *job, QObject *parent = nullptr);
qint64 bytesAvailable() const Q_DECL_OVERRIDE;
qint64 readData(char *data, qint64 maxSize) Q_DECL_OVERRIDE;

View File

@ -447,7 +447,7 @@ void OpenSearchEngine::imageObtained()
}
m_image.loadFromData(response);
emit imageChanged();
Q_EMIT imageChanged();
}
/*!
@ -479,7 +479,7 @@ void OpenSearchEngine::setImage(const QImage &image)
}
m_image = image;
emit imageChanged();
Q_EMIT imageChanged();
}
/*!
@ -648,7 +648,7 @@ void OpenSearchEngine::suggestionsObtained()
out.append(v.toString());
}
emit suggestions(out);
Q_EMIT suggestions(out);
}
/*!

View File

@ -193,7 +193,7 @@ void SearchEnginesManager::restoreDefaults()
m_defaultEngine = duck;
emit enginesChanged();
Q_EMIT enginesChanged();
}
// static
@ -225,7 +225,7 @@ void SearchEnginesManager::engineChangedImage()
if (index != -1) {
m_allEngines[index].icon = QIcon(QPixmap::fromImage(engine->image()));
emit enginesChanged();
Q_EMIT enginesChanged();
delete engine;
break;
@ -250,7 +250,7 @@ void SearchEnginesManager::addEngine(const Engine &engine)
m_allEngines.append(engine);
emit enginesChanged();
Q_EMIT enginesChanged();
}
void SearchEnginesManager::addEngineFromForm(const QVariantMap &formData, WebView *view)
@ -423,7 +423,7 @@ void SearchEnginesManager::setActiveEngine(const Engine &engine)
}
m_activeEngine = engine;
emit activeEngineChanged();
Q_EMIT activeEngineChanged();
}
void SearchEnginesManager::setDefaultEngine(const SearchEnginesManager::Engine &engine)
@ -435,7 +435,7 @@ void SearchEnginesManager::setDefaultEngine(const SearchEnginesManager::Engine &
}
m_defaultEngine = engine;
emit defaultEngineChanged();
Q_EMIT defaultEngineChanged();
}
void SearchEnginesManager::removeEngine(const Engine &engine)
@ -455,7 +455,7 @@ void SearchEnginesManager::removeEngine(const Engine &engine)
query.exec();
m_allEngines.remove(index);
emit enginesChanged();
Q_EMIT enginesChanged();
}
void SearchEnginesManager::setAllEngines(const QVector<Engine> &engines)
@ -463,7 +463,7 @@ void SearchEnginesManager::setAllEngines(const QVector<Engine> &engines)
ENSURE_LOADED;
m_allEngines = engines;
emit enginesChanged();
Q_EMIT enginesChanged();
}
QVector<SearchEngine> SearchEnginesManager::allEngines()

View File

@ -56,10 +56,10 @@ void AboutDialog::showAbout()
#endif
);
aboutHtml += tr("<b>QtWebEngine version %1</b></p>").arg(QStringLiteral(QTWEBENGINECORE_VERSION_STR));
aboutHtml += QString("<p>&copy; %1 %2<br/>").arg(Qz::COPYRIGHT, Qz::AUTHOR);
aboutHtml += QString("<a href=%1>%1</a></p>").arg(Qz::WWWADDRESS);
aboutHtml += "<p>" + mApp->userAgentManager()->defaultUserAgent() + "</p>";
aboutHtml += "</div>";
aboutHtml += QStringLiteral("<p>&copy; %1 %2<br/>").arg(Qz::COPYRIGHT, Qz::AUTHOR);
aboutHtml += QStringLiteral("<a href=%1>%1</a></p>").arg(Qz::WWWADDRESS);
aboutHtml += QStringLiteral("<p>") + mApp->userAgentManager()->defaultUserAgent() + QStringLiteral("</p>");
aboutHtml += QStringLiteral("</div>");
ui->textLabel->setText(aboutHtml);
setFixedHeight(sizeHint().height());
}

View File

@ -67,22 +67,22 @@ void ClearPrivateData::clearLocalStorage()
{
const QString profile = DataPaths::currentProfilePath();
QzTools::removeRecursively(profile + "/Local Storage");
QzTools::removeRecursively(profile + QStringLiteral("/Local Storage"));
}
void ClearPrivateData::clearWebDatabases()
{
const QString profile = DataPaths::currentProfilePath();
QzTools::removeRecursively(profile + "/IndexedDB");
QzTools::removeRecursively(profile + "/databases");
QzTools::removeRecursively(profile + QStringLiteral("/IndexedDB"));
QzTools::removeRecursively(profile + QStringLiteral("/databases"));
}
void ClearPrivateData::clearCache()
{
const QString profile = DataPaths::currentProfilePath();
QzTools::removeRecursively(profile + "/GPUCache");
QzTools::removeRecursively(profile + QStringLiteral("/GPUCache"));
mApp->webProfile()->clearHttpCache();
}
@ -161,11 +161,11 @@ void ClearPrivateData::optimizeDb()
mApp->setOverrideCursor(Qt::WaitCursor);
const QString profilePath = DataPaths::currentProfilePath();
QString sizeBefore = QzTools::fileSizeToString(QFileInfo(profilePath + "/browsedata.db").size());
QString sizeBefore = QzTools::fileSizeToString(QFileInfo(profilePath + QStringLiteral("/browsedata.db")).size());
IconProvider::instance()->clearOldIconsInDatabase();
QString sizeAfter = QzTools::fileSizeToString(QFileInfo(profilePath + "/browsedata.db").size());
QString sizeAfter = QzTools::fileSizeToString(QFileInfo(profilePath + QStringLiteral("/browsedata.db")).size());
mApp->restoreOverrideCursor();

View File

@ -43,7 +43,7 @@ SiteInfo::SiteInfo(WebView *view)
, ui(new Ui::SiteInfo)
, m_certWidget(0)
, m_view(view)
, m_imageReply(Q_NULLPTR)
, m_imageReply(nullptr)
, m_baseUrl(view->url())
{
setAttribute(Qt::WA_DeleteOnClose);

View File

@ -82,7 +82,7 @@ void StatusBarButton::clicked()
c->popupClosed = [=]() {
delete c;
};
emit m_button->clicked(c);
Q_EMIT m_button->clicked(c);
if (!c->popupOpened) {
c->popupClosed();
}

View File

@ -218,20 +218,20 @@ bool PluginProxy::acceptNavigationRequest(WebPage *page, const QUrl &url, QWebEn
void PluginProxy::emitWebPageCreated(WebPage* page)
{
emit webPageCreated(page);
Q_EMIT webPageCreated(page);
}
void PluginProxy::emitWebPageDeleted(WebPage* page)
{
emit webPageDeleted(page);
Q_EMIT webPageDeleted(page);
}
void PluginProxy::emitMainWindowCreated(BrowserWindow* window)
{
emit mainWindowCreated(window);
Q_EMIT mainWindowCreated(window);
}
void PluginProxy::emitMainWindowDeleted(BrowserWindow* window)
{
emit mainWindowDeleted(window);
Q_EMIT mainWindowDeleted(window);
}

View File

@ -93,7 +93,7 @@ void Plugins::unloadPlugin(Plugins::Plugin* plugin)
}
plugin->instance->unload();
emit pluginUnloaded(plugin->instance);
Q_EMIT pluginUnloaded(plugin->instance);
plugin->instance = nullptr;
m_availablePlugins.removeOne(*plugin);
@ -127,7 +127,7 @@ void Plugins::removePlugin(Plugins::Plugin *plugin)
}
m_availablePlugins.removeOne(*plugin);
emit availablePluginsChanged();
Q_EMIT availablePluginsChanged();
}
bool Plugins::addPlugin(const QString &id)
@ -141,7 +141,7 @@ bool Plugins::addPlugin(const QString &id)
return false;
}
registerAvailablePlugin(plugin);
emit availablePluginsChanged();
Q_EMIT availablePluginsChanged();
return true;
}
@ -221,7 +221,7 @@ PluginSpec Plugins::createSpec(const DesktopFile &metaData)
void Plugins::loadPlugins()
{
QDir settingsDir(DataPaths::currentProfilePath() + "/extensions/");
QDir settingsDir(DataPaths::currentProfilePath() + QStringLiteral("/extensions/"));
if (!settingsDir.exists()) {
settingsDir.mkdir(settingsDir.absolutePath());
}
@ -312,7 +312,7 @@ void Plugins::refreshLoadedPlugins()
}
}
emit availablePluginsChanged();
Q_EMIT availablePluginsChanged();
}
void Plugins::loadPythonSupport()
@ -472,7 +472,7 @@ bool Plugins::initPlugin(PluginInterface::InitState state, Plugin *plugin)
plugin->instance->init(state, DataPaths::currentProfilePath() + QL1S("/extensions"));
if (!plugin->instance->testPlugin()) {
emit pluginUnloaded(plugin->instance);
Q_EMIT pluginUnloaded(plugin->instance);
plugin->instance = nullptr;
return false;
}

View File

@ -26,17 +26,17 @@ QmlBookmarks::QmlBookmarks(QObject *parent)
{
connect(mApp->bookmarks(), &Bookmarks::bookmarkAdded, this, [this](BookmarkItem *item){
auto treeNode = QmlStaticData::instance().getBookmarkTreeNode(item);
emit created(treeNode);
Q_EMIT created(treeNode);
});
connect(mApp->bookmarks(), &Bookmarks::bookmarkChanged, this, [this](BookmarkItem *item){
auto treeNode = QmlStaticData::instance().getBookmarkTreeNode(item);
emit changed(treeNode);
Q_EMIT changed(treeNode);
});
connect(mApp->bookmarks(), &Bookmarks::bookmarkRemoved, this, [this](BookmarkItem *item){
auto treeNode = QmlStaticData::instance().getBookmarkTreeNode(item);
emit removed(treeNode);
Q_EMIT removed(treeNode);
});
}

View File

@ -78,7 +78,7 @@ QString QmlBrowserAction::identity() const
void QmlBrowserAction::setIdentity(const QString &identity)
{
m_identity = identity;
emit identityChanged(m_identity);
Q_EMIT identityChanged(m_identity);
}
QString QmlBrowserAction::name() const
@ -89,7 +89,7 @@ QString QmlBrowserAction::name() const
void QmlBrowserAction::setName(const QString &name)
{
m_name = name;
emit nameChanged(m_name);
Q_EMIT nameChanged(m_name);
}
QString QmlBrowserAction::title() const
@ -100,7 +100,7 @@ QString QmlBrowserAction::title() const
void QmlBrowserAction::setTitle(const QString &title)
{
m_title = title;
emit titleChanged(m_title);
Q_EMIT titleChanged(m_title);
}
QString QmlBrowserAction::toolTip() const
@ -111,7 +111,7 @@ QString QmlBrowserAction::toolTip() const
void QmlBrowserAction::setToolTip(const QString &toolTip)
{
m_toolTip = toolTip;
emit toolTipChanged(m_toolTip);
Q_EMIT toolTipChanged(m_toolTip);
}
QString QmlBrowserAction::icon() const
@ -122,7 +122,7 @@ QString QmlBrowserAction::icon() const
void QmlBrowserAction::setIcon(const QString &icon)
{
m_icon = icon;
emit iconChanged(m_icon);
Q_EMIT iconChanged(m_icon);
}
QString QmlBrowserAction::badgeText() const
@ -133,7 +133,7 @@ QString QmlBrowserAction::badgeText() const
void QmlBrowserAction::setBadgeText(const QString &badgeText)
{
m_badgeText = badgeText;
emit badgeTextChanged(m_badgeText);
Q_EMIT badgeTextChanged(m_badgeText);
}
QQmlComponent *QmlBrowserAction::popup() const
@ -144,13 +144,13 @@ QQmlComponent *QmlBrowserAction::popup() const
void QmlBrowserAction::setPopup(QQmlComponent *popup)
{
m_popup = popup;
emit popupChanged(m_popup);
Q_EMIT popupChanged(m_popup);
}
void QmlBrowserAction::setLocation(const Locations &locations)
{
m_locations = locations;
emit locationChanged(m_locations);
Q_EMIT locationChanged(m_locations);
}
void QmlBrowserAction::addButton(BrowserWindow *window)

View File

@ -30,7 +30,7 @@ QmlCookies::QmlCookies(QObject *parent)
QVariantMap map;
map.insert(QSL("cookie"), QVariant::fromValue(cookie));
map.insert(QSL("removed"), false);
emit changed(map);
Q_EMIT changed(map);
});
connect(mApp->cookieJar(), &CookieJar::cookieRemoved, this, [this](const QNetworkCookie &network_cookie){
@ -38,7 +38,7 @@ QmlCookies::QmlCookies(QObject *parent)
QVariantMap map;
map.insert(QSL("cookie"), QVariant::fromValue(cookie));
map.insert(QSL("removed"), true);
emit changed(map);
Q_EMIT changed(map);
});
}

View File

@ -29,7 +29,7 @@ QmlExtensionScheme::QmlExtensionScheme(QObject *parent)
connect(m_schemeHandler, &QmlExtensionSchemeHandler::_requestStarted, this, [this](QWebEngineUrlRequestJob *job) {
auto *qmlRequest = new QmlWebEngineUrlRequestJob(job);
const QJSValue request = qmlEngine(this)->newQObject(qmlRequest);
emit requestStarted(request);
Q_EMIT requestStarted(request);
});
}
@ -56,5 +56,5 @@ void QmlExtensionScheme::setName(const QString &name)
void QmlExtensionSchemeHandler::requestStarted(QWebEngineUrlRequestJob *job)
{
emit _requestStarted(job);
Q_EMIT _requestStarted(job);
}

View File

@ -27,12 +27,12 @@ QmlHistory::QmlHistory(QObject *parent)
{
connect(mApp->history(), &History::historyEntryAdded, this, [this](const HistoryEntry &entry){
QmlHistoryItem *historyItem = QmlStaticData::instance().getHistoryItem(entry);
emit visited(historyItem);
Q_EMIT visited(historyItem);
});
connect(mApp->history(), &History::historyEntryDeleted, this, [this](const HistoryEntry &entry){
QmlHistoryItem *historyItem = QmlStaticData::instance().getHistoryItem(entry);
emit visitRemoved(historyItem);
Q_EMIT visitRemoved(historyItem);
});
}

View File

@ -61,7 +61,7 @@ SideBarInterface *QmlSideBar::sideBar() const
void QmlSideBar::setName(const QString &name)
{
m_name = name;
emit nameChanged(m_name);
Q_EMIT nameChanged(m_name);
}
QString QmlSideBar::title() const
@ -72,7 +72,7 @@ QString QmlSideBar::title() const
void QmlSideBar::setTitle(const QString &title)
{
m_title = title;
emit titleChanged(title);
Q_EMIT titleChanged(title);
}
QString QmlSideBar::icon() const
@ -83,7 +83,7 @@ QString QmlSideBar::icon() const
void QmlSideBar::setIcon(const QString &icon)
{
m_iconUrl = icon;
emit iconChanged(m_iconUrl);
Q_EMIT iconChanged(m_iconUrl);
}
QString QmlSideBar::shortcut() const
@ -94,7 +94,7 @@ QString QmlSideBar::shortcut() const
void QmlSideBar::setShortcut(const QString &shortcut)
{
m_shortcut = shortcut;
emit shortcutChanged(m_shortcut);
Q_EMIT shortcutChanged(m_shortcut);
}
bool QmlSideBar::checkable()
@ -105,7 +105,7 @@ bool QmlSideBar::checkable()
void QmlSideBar::setCheckable(bool checkable)
{
m_checkable = checkable;
emit checkableChanged(m_checkable);
Q_EMIT checkableChanged(m_checkable);
}
QQmlComponent *QmlSideBar::item() const
@ -116,7 +116,7 @@ QQmlComponent *QmlSideBar::item() const
void QmlSideBar::setItem(QQmlComponent *item)
{
m_item = item;
emit itemChanged(m_item);
Q_EMIT itemChanged(m_item);
}
QmlSideBarHelper::QmlSideBarHelper(QObject *parent)

View File

@ -379,32 +379,32 @@ void QmlTab::createConnections()
Q_ASSERT(m_lambdaConnections.length() == 0);
auto titleChangedConnection = connect(m_webTab, &WebTab::titleChanged, this, [this](const QString &title){
emit titleChanged(title);
Q_EMIT titleChanged(title);
});
m_lambdaConnections.append(titleChangedConnection);
auto pinnedChangedConnection = connect(m_webTab, &WebTab::pinnedChanged, this, [this](bool pinned){
emit pinnedChanged(pinned);
Q_EMIT pinnedChanged(pinned);
});
m_lambdaConnections.append(pinnedChangedConnection);
auto loadingChangedConnection = connect(m_webTab, &WebTab::loadingChanged, this, [this](bool loading){
emit loadingChanged(loading);
Q_EMIT loadingChanged(loading);
});
m_lambdaConnections.append(loadingChangedConnection);
auto mutedChangedConnection = connect(m_webTab, &WebTab::mutedChanged, this, [this](bool muted){
emit mutedChanged(muted);
Q_EMIT mutedChanged(muted);
});
m_lambdaConnections.append(mutedChangedConnection);
auto restoredChangedConnection = connect(m_webTab, &WebTab::restoredChanged, this, [this](bool restored){
emit restoredChanged(restored);
Q_EMIT restoredChanged(restored);
});
m_lambdaConnections.append(restoredChangedConnection);
auto playingChangedConnection = connect(m_webTab, &WebTab::playingChanged, this, [this](bool playing){
emit playingChanged(playing);
Q_EMIT playingChanged(playing);
});
m_lambdaConnections.append(playingChangedConnection);

View File

@ -336,21 +336,21 @@ void QmlTabs::windowCreated(BrowserWindow *window)
const int windowId = QmlStaticData::instance().windowIdHash().value(window, -1);
connect(window->tabWidget(), &TabWidget::changed, this, [this, windowId]{
emit changed(windowId);
Q_EMIT changed(windowId);
});
connect(window->tabWidget(), &TabWidget::tabInserted, this, [this, windowId](int index){
QVariantMap map;
map.insert(QSL("windowId"), windowId);
map.insert(QSL("index"), index);
emit tabInserted(map);
Q_EMIT tabInserted(map);
});
connect(window->tabWidget(), &TabWidget::tabRemoved, this, [this, windowId](int index){
QVariantMap map;
map.insert(QSL("windowId"), windowId);
map.insert(QSL("index"), index);
emit tabRemoved(map);
Q_EMIT tabRemoved(map);
});
connect(window->tabWidget(), &TabWidget::tabMoved, this, [this, windowId](int from, int to){
@ -358,6 +358,6 @@ void QmlTabs::windowCreated(BrowserWindow *window)
map.insert(QSL("windowId"), windowId);
map.insert(QSL("from"), from);
map.insert(QSL("to"), to);
emit tabMoved(map);
Q_EMIT tabMoved(map);
});
}

View File

@ -51,7 +51,7 @@ QString QmlUserScript::name() const
void QmlUserScript::setName(const QString &name)
{
m_webEngineScript.setName(name);
emit nameChanged(name);
Q_EMIT nameChanged(name);
aboutToUpdateUnderlyingScript();
}
@ -63,7 +63,7 @@ bool QmlUserScript::runsOnSubFrames() const
void QmlUserScript::setRunsOnSubFrames(bool runsOnSubFrames)
{
m_webEngineScript.setRunsOnSubFrames(runsOnSubFrames);
emit runsOnSubFramesChanged(runsOnSubFrames);
Q_EMIT runsOnSubFramesChanged(runsOnSubFrames);
aboutToUpdateUnderlyingScript();
}
@ -87,7 +87,7 @@ void QmlUserScript::setWorldId(int worldId)
default:
break;
}
emit worldIdChanged(worldId);
Q_EMIT worldIdChanged(worldId);
aboutToUpdateUnderlyingScript();
}
@ -99,7 +99,7 @@ QString QmlUserScript::sourceCode() const
void QmlUserScript::setSourceCode(const QString &sourceCode)
{
m_webEngineScript.setSourceCode(sourceCode);
emit sourceCodeChanged(sourceCode);
Q_EMIT sourceCodeChanged(sourceCode);
aboutToUpdateUnderlyingScript();
}
@ -123,7 +123,7 @@ void QmlUserScript::setInjectionPoint(InjectionPoint injectionPoint)
default:
break;
}
emit injectionPointChanged(injectionPoint);
Q_EMIT injectionPointChanged(injectionPoint);
aboutToUpdateUnderlyingScript();
}

View File

@ -26,12 +26,12 @@ QmlWindows::QmlWindows(QObject *parent)
{
connect(mApp->plugins(), &PluginProxy::mainWindowCreated, this, [this](BrowserWindow *window){
QmlWindow *qmlWindow = QmlStaticData::instance().getWindow(window);
emit created(qmlWindow);
Q_EMIT created(qmlWindow);
});
connect(mApp->plugins(), &PluginProxy::mainWindowDeleted, this, [this](BrowserWindow *window){
QmlWindow *qmlWindow = QmlStaticData::instance().getWindow(window);
emit removed(qmlWindow);
Q_EMIT removed(qmlWindow);
});
}

View File

@ -73,7 +73,7 @@ void QmlPluginInterface::unload()
childItem->deleteLater();
}
emit qmlPluginUnloaded();
Q_EMIT qmlPluginUnloaded();
}
bool QmlPluginInterface::testPlugin()

View File

@ -130,7 +130,7 @@ void SpeedDial::addPage(const QUrl &url, const QString &title)
m_pages.append(page);
m_regenerateScript = true;
emit pagesChanged();
Q_EMIT pagesChanged();
}
void SpeedDial::removePage(const Page &page)
@ -145,7 +145,7 @@ void SpeedDial::removePage(const Page &page)
m_pages.removeAll(page);
m_regenerateScript = true;
emit pagesChanged();
Q_EMIT pagesChanged();
}
int SpeedDial::pagesInRow()
@ -252,7 +252,7 @@ void SpeedDial::changed(const QString &allPages)
}
m_regenerateScript = true;
emit pagesChanged();
Q_EMIT pagesChanged();
}
void SpeedDial::loadThumbnail(const QString &url, bool loadTitle)
@ -345,9 +345,9 @@ void SpeedDial::thumbnailCreated(const QPixmap &pixmap)
thumbnailer->deleteLater();
if (loadTitle)
emit pageTitleLoaded(url, title);
Q_EMIT pageTitleLoaded(url, title);
emit thumbnailLoaded(url, QzTools::pixmapToDataUrl(QPixmap(fileName)).toString());
Q_EMIT thumbnailLoaded(url, QzTools::pixmapToDataUrl(QPixmap(fileName)).toString());
}
QString SpeedDial::escapeTitle(QString title) const

View File

@ -112,7 +112,7 @@ void PluginsManager::refresh()
}
item->setIcon(icon);
QString pluginInfo = QString("<b>%1</b> %2<br/><i>%3</i><br/>").arg(spec.name, spec.version, spec.author.toHtmlEscaped());
const QString pluginInfo = QStringLiteral("<b>%1</b> %2<br/><i>%3</i><br/>").arg(spec.name, spec.version, spec.author.toHtmlEscaped());
item->setToolTip(pluginInfo);
item->setText(spec.name);

View File

@ -69,8 +69,8 @@ static QString createLanguageItem(const QString &lang)
return lang;
}
QString country = QLocale::countryToString(locale.country());
QString language = QLocale::languageToString(locale.language());
const QString country = QLocale::countryToString(locale.country());
const QString language = QLocale::languageToString(locale.language());
if (lang == QLatin1String("es_ES")) {
return QString::fromUtf8("Castellano");
@ -90,7 +90,7 @@ static QString createLanguageItem(const QString &lang)
if (lang == QLatin1String("sr@ijekavianlatin")) {
return QString::fromUtf8("srpski ijekavski");
}
return QString("%1, %2 (%3)").arg(language, country, lang);
return QStringLiteral("%1, %2 (%3)").arg(language, country, lang);
}
Preferences::Preferences(BrowserWindow* window)
@ -117,19 +117,19 @@ Preferences::Preferences(BrowserWindow* window)
ui->listWidget->item(index)->setIcon(QIcon(icon.pixmap(32)));
};
setCategoryIcon(0, QIcon(":/icons/preferences/general.svg"));
setCategoryIcon(1, QIcon(":/icons/preferences/appearance.svg"));
setCategoryIcon(2, QIcon(":/icons/preferences/tabs.svg"));
setCategoryIcon(3, QIcon(":/icons/preferences/browsing.svg"));
setCategoryIcon(4, QIcon(":/icons/preferences/fonts.svg"));
setCategoryIcon(5, QIcon(":/icons/preferences/shortcuts.svg"));
setCategoryIcon(6, QIcon(":/icons/preferences/downloads.svg"));
setCategoryIcon(7, QIcon(":/icons/preferences/passwords.svg"));
setCategoryIcon(8, QIcon(":/icons/preferences/privacy.svg"));
setCategoryIcon(9, QIcon(":/icons/preferences/notifications.svg"));
setCategoryIcon(10, QIcon(":/icons/preferences/extensions.svg"));
setCategoryIcon(11, QIcon(":/icons/preferences/spellcheck.svg"));
setCategoryIcon(12, QIcon(":/icons/preferences/other.svg"));
setCategoryIcon(0, QIcon(QStringLiteral(":/icons/preferences/general.svg")));
setCategoryIcon(1, QIcon(QStringLiteral(":/icons/preferences/appearance.svg")));
setCategoryIcon(2, QIcon(QStringLiteral(":/icons/preferences/tabs.svg")));
setCategoryIcon(3, QIcon(QStringLiteral(":/icons/preferences/browsing.svg")));
setCategoryIcon(4, QIcon(QStringLiteral(":/icons/preferences/fonts.svg")));
setCategoryIcon(5, QIcon(QStringLiteral(":/icons/preferences/shortcuts.svg")));
setCategoryIcon(6, QIcon(QStringLiteral(":/icons/preferences/downloads.svg")));
setCategoryIcon(7, QIcon(QStringLiteral(":/icons/preferences/passwords.svg")));
setCategoryIcon(8, QIcon(QStringLiteral(":/icons/preferences/privacy.svg")));
setCategoryIcon(9, QIcon(QStringLiteral(":/icons/preferences/notifications.svg")));
setCategoryIcon(10, QIcon(QStringLiteral(":/icons/preferences/extensions.svg")));
setCategoryIcon(11, QIcon(QStringLiteral(":/icons/preferences/spellcheck.svg")));
setCategoryIcon(12, QIcon(QStringLiteral(":/icons/preferences/other.svg")));
Settings settings;
//GENERAL URLs
@ -198,7 +198,7 @@ Preferences::Preferences(BrowserWindow* window)
// PROFILES
QString startingProfile = ProfileManager::startingProfile();
ui->activeProfile->setText("<b>" + ProfileManager::currentProfile() + "</b>");
ui->activeProfile->setText(QStringLiteral("<b>") + ProfileManager::currentProfile() + QStringLiteral("</b>"));
ui->startProfile->addItem(startingProfile);
const auto names = ProfileManager::availableProfiles();

View File

@ -129,7 +129,7 @@ ThemeManager::Theme ThemeManager::parseTheme(const QString &path, const QString
Theme info;
info.isValid = false;
if (!QFile(path + "main.css").exists() || !QFile(path + "metadata.desktop").exists()) {
if (!QFile(path + QStringLiteral("main.css")).exists() || !QFile(path + "metadata.desktop").exists()) {
info.isValid = false;
return info;
}

View File

@ -29,7 +29,7 @@
RecoveryJsObject::RecoveryJsObject(RestoreManager *manager)
: QObject()
, m_manager(manager)
, m_page(Q_NULLPTR)
, m_page(nullptr)
{
}

View File

@ -213,7 +213,7 @@ void SessionManager::newSession()
if (!ok)
return;
const QString filePath = QString("%1/%2.dat").arg(DataPaths::path(DataPaths::Sessions)).arg(sessionName);
const QString filePath = QStringLiteral("%1/%2.dat").arg(DataPaths::path(DataPaths::Sessions)).arg(sessionName);
if (QFile::exists(filePath)) {
QMessageBox::information(mApp->activeWindow(), tr("Error!"), tr("The session file \"%1\" exists. Please enter another name.").arg(sessionName));
newSession();

View File

@ -207,7 +207,7 @@ void SideBarManager::showSideBar(const QString &id, bool toggle)
void SideBarManager::sideBarRemoved(const QString &id)
{
if (m_activeBar == id && m_sideBar) {
m_sideBar.data()->setWidget(Q_NULLPTR);
m_sideBar.data()->setWidget(nullptr);
m_sideBar.data()->close();
}
}

View File

@ -276,24 +276,24 @@ void ComboTabBar::slotCurrentChanged(int index)
if (index == -1 && m_mainTabBar->count() > 0) {
m_mainTabBar->setActiveTabBar(true);
m_pinnedTabBar->setActiveTabBar(false);
emit currentChanged(pinnedTabsCount());
Q_EMIT currentChanged(pinnedTabsCount());
}
else {
m_pinnedTabBar->setActiveTabBar(true);
m_mainTabBar->setActiveTabBar(false);
emit currentChanged(index);
Q_EMIT currentChanged(index);
}
}
else {
if (index == -1 && pinnedTabsCount() > 0) {
m_pinnedTabBar->setActiveTabBar(true);
m_mainTabBar->setActiveTabBar(false);
emit currentChanged(pinnedTabsCount() - 1);
Q_EMIT currentChanged(pinnedTabsCount() - 1);
}
else {
m_mainTabBar->setActiveTabBar(true);
m_pinnedTabBar->setActiveTabBar(false);
emit currentChanged(index + pinnedTabsCount());
Q_EMIT currentChanged(index + pinnedTabsCount());
}
}
}
@ -301,20 +301,20 @@ void ComboTabBar::slotCurrentChanged(int index)
void ComboTabBar::slotTabCloseRequested(int index)
{
if (sender() == m_pinnedTabBar) {
emit tabCloseRequested(index);
Q_EMIT tabCloseRequested(index);
}
else {
emit tabCloseRequested(index + pinnedTabsCount());
Q_EMIT tabCloseRequested(index + pinnedTabsCount());
}
}
void ComboTabBar::slotTabMoved(int from, int to)
{
if (sender() == m_pinnedTabBar) {
emit tabMoved(from, to);
Q_EMIT tabMoved(from, to);
}
else {
emit tabMoved(from + pinnedTabsCount(), to + pinnedTabsCount());
Q_EMIT tabMoved(from + pinnedTabsCount(), to + pinnedTabsCount());
}
}
@ -332,7 +332,7 @@ void ComboTabBar::closeTabFromButton()
}
if (tabToClose != -1) {
emit tabCloseRequested(tabToClose + pinnedTabsCount());
Q_EMIT tabCloseRequested(tabToClose + pinnedTabsCount());
}
}
@ -345,7 +345,7 @@ void ComboTabBar::updateTabBars()
void ComboTabBar::emitOverFlowChanged()
{
if (m_mainBarOverFlowed != m_lastAppliedOverflow) {
emit overFlowChanged(m_mainBarOverFlowed);
Q_EMIT overFlowChanged(m_mainBarOverFlowed);
m_lastAppliedOverflow = m_mainBarOverFlowed;
}
}
@ -1183,7 +1183,7 @@ bool TabBarHelper::isDragInProgress() const
void TabBarHelper::setCurrentIndex(int index)
{
if (index == currentIndex() && !m_activeTabBar) {
emit currentChanged(currentIndex());
Q_EMIT currentChanged(currentIndex());
}
QTabBar::setCurrentIndex(index);
@ -1393,7 +1393,7 @@ void TabBarHelper::mousePressEvent(QMouseEvent* event)
m_dragStartPosition = event->pos();
// virtualize selecting tab by click
if (m_pressedIndex == currentIndex() && !m_activeTabBar) {
emit currentChanged(currentIndex());
Q_EMIT currentChanged(currentIndex());
}
}
}

View File

@ -282,7 +282,7 @@ QSize TabBar::tabSizeHint(int index, bool fast) const
xForAddTabButton = width() - xForAddTabButton;
}
emit tabBar->moveAddTabButton(xForAddTabButton);
Q_EMIT tabBar->moveAddTabButton(xForAddTabButton);
}
return size;
@ -486,7 +486,7 @@ void TabBar::tabRemoved(int index)
int xForAddTabButton = cornerWidth(Qt::TopLeftCorner) + pinTabBarWidth();
if (QApplication::layoutDirection() == Qt::RightToLeft)
xForAddTabButton = width() - xForAddTabButton;
emit moveAddTabButton(xForAddTabButton);
Q_EMIT moveAddTabButton(xForAddTabButton);
}
}

View File

@ -33,7 +33,7 @@ TabContextMenu::TabContextMenu(int index, BrowserWindow *window, Options options
, m_window(window)
, m_options(options)
{
setObjectName("tabcontextmenu");
setObjectName(QStringLiteral("tabcontextmenu"));
TabWidget *tabWidget = m_window->tabWidget();
connect(this, &TabContextMenu::tabCloseRequested, tabWidget->tabBar(), &ComboTabBar::tabCloseRequested);
@ -78,7 +78,7 @@ static bool canCloseTabs(const QString &settingsKey, const QString &title, const
void TabContextMenu::closeAllButCurrent()
{
if (canCloseTabs(QLatin1String("AskOnClosingAllButCurrent"), tr("Close Tabs"), tr("Do you really want to close other tabs?"))) {
emit closeAllButCurrent(m_clickedTab);
Q_EMIT closeAllButCurrent(m_clickedTab);
}
}
@ -89,7 +89,7 @@ void TabContextMenu::closeToRight()
: tr("Do you really want to close all tabs to the bottom?");
if (canCloseTabs(QLatin1String("AskOnClosingToRight"), tr("Close Tabs"), label)) {
emit closeToRight(m_clickedTab);
Q_EMIT closeToRight(m_clickedTab);
}
}
@ -100,7 +100,7 @@ void TabContextMenu::closeToLeft()
: tr("Do you really want to close all tabs to the top?");
if (canCloseTabs(QLatin1String("AskOnClosingToLeft"), tr("Close Tabs"), label)) {
emit closeToLeft(m_clickedTab);
Q_EMIT closeToLeft(m_clickedTab);
}
}

View File

@ -133,7 +133,7 @@ void TabIcon::show()
}
setFixedSize(16, qMax(minimumHeight(), 16));
emit resized();
Q_EMIT resized();
QWidget::show();
}
@ -148,7 +148,7 @@ void TabIcon::hide()
}
setFixedSize(1, qMax(minimumHeight(), 16));
emit resized();
Q_EMIT resized();
QWidget::hide();
}

View File

@ -232,7 +232,7 @@ void TabModel::tabInserted(int index)
auto emitDataChanged = [this](WebTab *tab, int role) {
const QModelIndex idx = tabIndex(tab);
emit dataChanged(idx, idx, {role});
Q_EMIT dataChanged(idx, idx, {role});
};
connect(tab, &WebTab::titleChanged, this, std::bind(emitDataChanged, tab, Qt::DisplayRole));

View File

@ -169,7 +169,7 @@ void TabMruModel::currentTabChanged(int index)
void TabMruModel::sourceDataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight, const QVector<int> &roles)
{
emit dataChanged(mapFromSource(topLeft), mapFromSource(bottomRight), roles);
Q_EMIT dataChanged(mapFromSource(topLeft), mapFromSource(bottomRight), roles);
}
void TabMruModel::sourceRowsInserted(const QModelIndex &parent, int start, int end)

View File

@ -184,7 +184,7 @@ void TabStackedWidget::showTab(int index)
// This is slot connected to ComboTabBar::currentChanged
// We must send the signal even with invalid index (-1)
emit currentChanged(index);
Q_EMIT currentChanged(index);
}
bool TabStackedWidget::documentMode() const
@ -277,7 +277,7 @@ int TabStackedWidget::pinUnPinTab(int index, const QString &title)
// Restore current widget
setCurrentWidget(currentWidget);
emit pinStateChanged(newIndex, makePinned);
Q_EMIT pinStateChanged(newIndex, makePinned);
return newIndex;
}

View File

@ -307,7 +307,7 @@ TabTreeModelItem *TabTreeModel::createItems(TabTreeModelItem *root)
void TabTreeModel::sourceDataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight, const QVector<int> &roles)
{
emit dataChanged(mapFromSource(topLeft), mapFromSource(bottomRight), roles);
Q_EMIT dataChanged(mapFromSource(topLeft), mapFromSource(bottomRight), roles);
}
void TabTreeModel::sourceRowsInserted(const QModelIndex &parent, int start, int end)

View File

@ -72,7 +72,7 @@ void MenuTabs::mouseReleaseEvent(QMouseEvent* event)
if (action && action->isEnabled()) {
auto* tab = qobject_cast<WebTab*>(qvariant_cast<QWidget*>(action->data()));
if (tab) {
emit closeTab(tab->tabIndex());
Q_EMIT closeTab(tab->tabIndex());
action->setEnabled(false);
event->accept();
}
@ -386,8 +386,8 @@ int TabWidget::addView(const LoadRequest &req, const QString &title, const Qz::N
m_tabBar->ensureVisible(index);
}
emit changed();
emit tabInserted(index);
Q_EMIT changed();
Q_EMIT tabInserted(index);
return index;
}
@ -418,8 +418,8 @@ int TabWidget::insertView(int index, WebTab *tab, const Qz::NewTabPositionFlags
m_tabBar->ensureVisible(index);
}
emit changed();
emit tabInserted(newIndex);
Q_EMIT changed();
Q_EMIT tabInserted(newIndex);
return newIndex;
}
@ -464,8 +464,8 @@ void TabWidget::closeTab(int index)
updateClosedTabsButton();
emit changed();
emit tabRemoved(index);
Q_EMIT changed();
Q_EMIT tabRemoved(index);
}
void TabWidget::requestCloseTab(int index)
@ -518,16 +518,16 @@ void TabWidget::currentTabChanged(int index)
m_window->currentTabChanged();
emit changed();
Q_EMIT changed();
}
void TabWidget::tabWasMoved(int before, int after)
{
m_lastBackgroundTab = nullptr;
emit changed();
Q_EMIT changed();
if (!m_blockTabMovedSignal) {
emit tabMoved(before, after);
Q_EMIT tabMoved(before, after);
}
}
@ -668,14 +668,14 @@ void TabWidget::moveTab(int from, int to)
}
TabStackedWidget::moveTab(tab->tabIndex(), to);
m_blockTabMovedSignal = false;
emit tabMoved(from, to);
Q_EMIT tabMoved(from, to);
}
int TabWidget::pinUnPinTab(int index, const QString &title)
{
const int newIndex = TabStackedWidget::pinUnPinTab(index, title);
if (index != newIndex && !m_blockTabMovedSignal) {
emit tabMoved(index, newIndex);
Q_EMIT tabMoved(index, newIndex);
}
return newIndex;
}
@ -698,7 +698,7 @@ void TabWidget::detachTab(WebTab* tab)
tab->detach();
tab->setPinned(false);
emit tabRemoved(index);
Q_EMIT tabRemoved(index);
if (count() == 0) {
m_window->close();

View File

@ -39,7 +39,7 @@ void AbstractButtonInterface::setActive(bool active)
}
m_active = active;
emit activeChanged(m_active);
Q_EMIT activeChanged(m_active);
}
bool AbstractButtonInterface::isVisible() const
@ -54,7 +54,7 @@ void AbstractButtonInterface::setVisible(bool visible)
}
m_visible = visible;
emit visibleChanged(m_visible);
Q_EMIT visibleChanged(m_visible);
}
QString AbstractButtonInterface::title() const
@ -69,7 +69,7 @@ void AbstractButtonInterface::setTitle(const QString &title)
}
m_title = title;
emit titleChanged(m_title);
Q_EMIT titleChanged(m_title);
}
QString AbstractButtonInterface::toolTip() const
@ -84,7 +84,7 @@ void AbstractButtonInterface::setToolTip(const QString &toolTip)
}
m_toolTip = toolTip;
emit toolTipChanged(m_toolTip);
Q_EMIT toolTipChanged(m_toolTip);
}
QIcon AbstractButtonInterface::icon() const
@ -95,7 +95,7 @@ QIcon AbstractButtonInterface::icon() const
void AbstractButtonInterface::setIcon(const QIcon &icon)
{
m_icon = icon;
emit iconChanged(icon);
Q_EMIT iconChanged(icon);
}
QString AbstractButtonInterface::badgeText() const
@ -110,7 +110,7 @@ void AbstractButtonInterface::setBadgeText(const QString &badgeText)
}
m_badgeText = badgeText;
emit badgeTextChanged(m_badgeText);
Q_EMIT badgeTextChanged(m_badgeText);
}
WebView *AbstractButtonInterface::webView() const
@ -125,5 +125,5 @@ void AbstractButtonInterface::setWebView(WebView *view)
}
m_view = view;
emit webViewChanged(m_view);
Q_EMIT webViewChanged(m_view);
}

View File

@ -37,7 +37,6 @@ const int AesInterface::VERSION = 1;
AesInterface::AesInterface(QObject* parent)
: QObject(parent)
, m_ok(false)
{
m_encodeCTX = EVP_CIPHER_CTX_new();
m_decodeCTX = EVP_CIPHER_CTX_new();
@ -53,7 +52,7 @@ AesInterface::~AesInterface()
EVP_CIPHER_CTX_free(m_decodeCTX);
}
bool AesInterface::isOk()
bool AesInterface::isOk() const
{
return m_ok;
}

View File

@ -39,7 +39,7 @@ public:
explicit AesInterface(QObject* parent = nullptr);
~AesInterface();
bool isOk();
bool isOk() const;
QByteArray encrypt(const QByteArray &plainData, const QByteArray &password);
QByteArray decrypt(const QByteArray &cipherData, const QByteArray &password);
@ -53,7 +53,7 @@ private:
EVP_CIPHER_CTX* m_encodeCTX;
EVP_CIPHER_CTX* m_decodeCTX;
bool m_ok;
bool m_ok = false;
QByteArray m_iVector;
};
#endif //AESINTERFACE_H

View File

@ -71,7 +71,7 @@ void ButtonWithMenu::addItem(const Item &item)
setCurrentItem(item);
}
emit itemAdded(item);
Q_EMIT itemAdded(item);
}
void ButtonWithMenu::addItems(const QVector<Item> &items)
@ -113,7 +113,7 @@ void ButtonWithMenu::setCurrentItem(const Item &item, bool emitSignal)
setToolTip(m_currentItem.text);
if (emitSignal) {
emit activeItemChanged(m_currentItem);
Q_EMIT activeItemChanged(m_currentItem);
}
}
@ -168,7 +168,7 @@ void ButtonWithMenu::generateMenu()
void ButtonWithMenu::mousePressEvent(QMouseEvent *event)
{
if (event->buttons() == Qt::LeftButton && parentWidget() && parentWidget()->parentWidget()) {
emit aboutToShowMenu();
Q_EMIT aboutToShowMenu();
QWidget *w = parentWidget()->parentWidget();
m_menu->popup(w->mapToGlobal(w->rect().bottomLeft()));
}

View File

@ -70,14 +70,14 @@ void ClickableLabel::mouseReleaseEvent(QMouseEvent* ev)
{
if (ev->button() == Qt::LeftButton && rect().contains(ev->pos())) {
if (ev->modifiers() == Qt::ControlModifier) {
emit middleClicked(ev->globalPos());
Q_EMIT middleClicked(ev->globalPos());
}
else {
emit clicked(ev->globalPos());
Q_EMIT clicked(ev->globalPos());
}
}
else if (ev->button() == Qt::MiddleButton && rect().contains(ev->pos())) {
emit middleClicked(ev->globalPos());
Q_EMIT middleClicked(ev->globalPos());
}
else {
QLabel::mouseReleaseEvent(ev);

View File

@ -51,10 +51,10 @@ void DelayedFileWatcher::slotFileChanged(const QString &path)
void DelayedFileWatcher::dequeueDirectory()
{
emit delayedDirectoryChanged(m_dirQueue.dequeue());
Q_EMIT delayedDirectoryChanged(m_dirQueue.dequeue());
}
void DelayedFileWatcher::dequeueFile()
{
emit delayedFileChanged(m_fileQueue.dequeue());
Q_EMIT delayedFileChanged(m_fileQueue.dequeue());
}

View File

@ -22,13 +22,11 @@
Menu::Menu(QWidget* parent)
: QMenu(parent)
, m_closeOnMiddleClick(false)
{
}
Menu::Menu(const QString &title, QWidget* parent)
: QMenu(title, parent)
, m_closeOnMiddleClick(false)
{
}
@ -56,7 +54,7 @@ void Menu::mouseReleaseEvent(QMouseEvent* e)
if (e->button() == Qt::MiddleButton || (e->button() == Qt::LeftButton && e->modifiers() == Qt::ControlModifier)) {
closeAllMenus();
emit menuMiddleClicked(m);
Q_EMIT menuMiddleClicked(m);
}
}
@ -143,10 +141,10 @@ Action::Action(const QIcon &icon, const QString &text, QObject* parent)
void Action::emitCtrlTriggered()
{
emit ctrlTriggered();
Q_EMIT ctrlTriggered();
}
void Action::emitShiftTriggered()
{
emit shiftTriggered();
Q_EMIT shiftTriggered();
}

View File

@ -47,7 +47,7 @@ private:
void closeAllMenus();
bool m_closeOnMiddleClick;
bool m_closeOnMiddleClick = false;
};
class FALKON_EXPORT Action : public QAction

View File

@ -23,7 +23,6 @@
HeaderView::HeaderView(QAbstractItemView* parent)
: QHeaderView(Qt::Horizontal, parent)
, m_parent(parent)
, m_menu(0)
, m_resizeOnShow(false)
{
setSectionsMovable(true);

View File

@ -42,8 +42,8 @@ private:
void showEvent(QShowEvent* event) override;
void contextMenuEvent(QContextMenuEvent* event) override;
QAbstractItemView* m_parent;
QMenu* m_menu;
QAbstractItemView* m_parent = nullptr;
QMenu* m_menu = nullptr;
bool m_resizeOnShow;
QList<double> m_sectionSizes;

View File

@ -82,7 +82,7 @@ void PageThumbnailer::start()
m_view->rootObject()->setProperty("url", m_url);
} else {
QTimer::singleShot(500, this, [this]() {
emit thumbnailCreated(QPixmap());
Q_EMIT thumbnailCreated(QPixmap());
});
}
}
@ -95,13 +95,13 @@ QString PageThumbnailer::afterLoadScript() const
void PageThumbnailer::createThumbnail(bool status)
{
if (!status) {
emit thumbnailCreated(QPixmap());
Q_EMIT thumbnailCreated(QPixmap());
return;
}
QTimer::singleShot(1000, this, [this]() {
m_title = m_view->rootObject()->property("title").toString().trimmed();
emit thumbnailCreated(QPixmap::fromImage(m_view->grabFramebuffer().scaled(m_size, Qt::IgnoreAspectRatio, Qt::SmoothTransformation)));
Q_EMIT thumbnailCreated(QPixmap::fromImage(m_view->grabFramebuffer().scaled(m_size, Qt::IgnoreAspectRatio, Qt::SmoothTransformation)));
});
}

View File

@ -83,7 +83,7 @@ void SqlQueryJob::start()
m_error = result.error;
m_lastInsertId = result.lastInsertId;
m_records = result.records;
emit finished(this);
Q_EMIT finished(this);
});
watcher->setFuture(QtConcurrent::run([=]() {

View File

@ -157,7 +157,7 @@ void ToolButton::setToolbarButtonLook(bool enable)
void ToolButton::menuAboutToHide()
{
setDown(false);
emit aboutToHideMenu();
Q_EMIT aboutToHideMenu();
}
void ToolButton::showMenu()
@ -165,7 +165,7 @@ void ToolButton::showMenu()
if (!m_menu || m_menu->isVisible())
return;
emit aboutToShowMenu();
Q_EMIT aboutToShowMenu();
QPoint pos;
@ -205,11 +205,11 @@ void ToolButton::mouseReleaseEvent(QMouseEvent* e)
m_pressTimer.stop();
if (e->button() == Qt::MiddleButton && rect().contains(e->pos())) {
emit middleMouseClicked();
Q_EMIT middleMouseClicked();
setDown(false);
}
else if (e->button() == Qt::LeftButton && rect().contains(e->pos()) && e->modifiers() == Qt::ControlModifier) {
emit controlClicked();
Q_EMIT controlClicked();
setDown(false);
} else {
QToolButton::mouseReleaseEvent(e);
@ -223,7 +223,7 @@ void ToolButton::mouseDoubleClickEvent(QMouseEvent* e)
m_pressTimer.stop();
if (e->buttons() == Qt::LeftButton) {
emit doubleClicked();
Q_EMIT doubleClicked();
}
}

View File

@ -65,11 +65,11 @@ void TreeWidget::insertTopLevelItems(int index, const QList<QTreeWidgetItem*> &i
void TreeWidget::mousePressEvent(QMouseEvent* event)
{
if (event->modifiers() == Qt::ControlModifier) {
emit itemControlClicked(itemAt(event->pos()));
Q_EMIT itemControlClicked(itemAt(event->pos()));
}
if (event->buttons() == Qt::MiddleButton) {
emit itemMiddleButtonClicked(itemAt(event->pos()));
Q_EMIT itemMiddleButtonClicked(itemAt(event->pos()));
}
QTreeWidget::mousePressEvent(event);

View File

@ -64,7 +64,7 @@ void ExternalJsObject::unregisterExtraObject(QObject *object)
QObject *ExternalJsObject::speedDial() const
{
if (m_page->url().toString() != QL1S("falkon:speeddial"))
return Q_NULLPTR;
return nullptr;
return mApp->plugins()->speedDial();
}
@ -77,7 +77,7 @@ QObject *ExternalJsObject::autoFill() const
QObject *ExternalJsObject::recovery() const
{
if (!mApp->restoreManager() || m_page->url().toString() != QL1S("falkon:restore"))
return Q_NULLPTR;
return nullptr;
return mApp->restoreManager()->recoveryObject(m_page);
}

View File

@ -33,7 +33,7 @@ QList<QWebEngineView*> WebInspector::s_views;
WebInspector::WebInspector(QWidget *parent)
: QWebEngineView(parent)
, m_view(Q_NULLPTR)
, m_view(nullptr)
{
setAttribute(Qt::WA_DeleteOnClose);
setObjectName(QSL("web-inspector"));

View File

@ -28,7 +28,7 @@ class FALKON_EXPORT WebInspector : public QWebEngineView
Q_OBJECT
public:
explicit WebInspector(QWidget *parent = Q_NULLPTR);
explicit WebInspector(QWidget *parent = nullptr);
~WebInspector();
void setView(WebView *view);

View File

@ -110,7 +110,7 @@ WebPage::WebPage(QObject* parent)
// Workaround for broken load started/finished signals in QtWebEngine 5.10, 5.11
connect(this, &QWebEnginePage::loadProgress, this, [this](int progress) {
if (progress == 100) {
emit loadFinished(true);
Q_EMIT loadFinished(true);
}
});
@ -265,7 +265,7 @@ void WebPage::progress(int prog)
if (secStatus != m_secureStatus) {
m_secureStatus = secStatus;
emit privacyChanged(secStatus);
Q_EMIT privacyChanged(secStatus);
}
}
@ -439,7 +439,7 @@ bool WebPage::acceptNavigationRequest(const QUrl &url, QWebEnginePage::Navigatio
return false;
#if QTWEBENGINEWIDGETS_VERSION < QT_VERSION_CHECK(5, 12, 0)
} else if (url.path() == QL1S("PrintPage")) {
emit printRequested();
Q_EMIT printRequested();
return false;
#endif
}
@ -457,7 +457,7 @@ bool WebPage::acceptNavigationRequest(const QUrl &url, QWebEnginePage::Navigatio
const bool globalJsEnabled = mApp->webSettings()->testAttribute(QWebEngineSettings::JavascriptEnabled);
settings()->setAttribute(QWebEngineSettings::JavascriptEnabled, isWeb ? globalJsEnabled : true);
}
emit navigationRequestAccepted(url, type, isMainFrame);
Q_EMIT navigationRequestAccepted(url, type, isMainFrame);
}
return result;

View File

@ -142,8 +142,8 @@ void WebView::setPage(WebPage *page)
if (m_page) {
if (m_page->isLoading()) {
emit m_page->loadProgress(100);
emit m_page->loadFinished(true);
Q_EMIT m_page->loadProgress(100);
Q_EMIT m_page->loadFinished(true);
}
mApp->plugins()->emitWebPageDeleted(m_page);
m_page->setView(nullptr);
@ -155,8 +155,8 @@ void WebView::setPage(WebPage *page)
m_page = page;
if (m_page->isLoading()) {
emit loadStarted();
emit loadProgress(m_page->m_loadProgress);
Q_EMIT loadStarted();
Q_EMIT loadProgress(m_page->m_loadProgress);
}
connect(m_page, &WebPage::privacyChanged, this, &WebView::privacyChanged);
@ -171,7 +171,7 @@ void WebView::setPage(WebPage *page)
// Scrollbars must be added only after QWebEnginePage is set
WebScrollBarManager::instance()->addWebView(this);
emit pageChanged(m_page);
Q_EMIT pageChanged(m_page);
mApp->plugins()->emitWebPageCreated(m_page);
}
@ -286,14 +286,14 @@ void WebView::setForceContextMenuOnMouseRelease(bool force)
void WebView::addNotification(QWidget* notif)
{
emit showNotification(notif);
Q_EMIT showNotification(notif);
}
void WebView::applyZoom()
{
setZoomFactor(qreal(zoomLevels().at(m_currentZoomLevel)) / 100.0);
emit zoomLevelChanged(m_currentZoomLevel);
Q_EMIT zoomLevelChanged(m_currentZoomLevel);
}
void WebView::zoomIn()
@ -368,7 +368,7 @@ void WebView::back()
if (history->canGoBack()) {
history->back();
emit urlChanged(url());
Q_EMIT urlChanged(url());
}
}
@ -379,7 +379,7 @@ void WebView::forward()
if (history->canGoForward()) {
history->forward();
emit urlChanged(url());
Q_EMIT urlChanged(url());
}
}
@ -416,7 +416,7 @@ void WebView::slotLoadStarted()
m_progress = 0;
if (title(/*allowEmpty*/true).isEmpty()) {
emit titleChanged(title());
Q_EMIT titleChanged(title());
}
}
@ -451,7 +451,7 @@ void WebView::slotUrlChanged(const QUrl &url)
// Don't treat this as background activity change
const bool oldActivity = m_backgroundActivity;
m_backgroundActivity = true;
emit titleChanged(title());
Q_EMIT titleChanged(title());
m_backgroundActivity = oldActivity;
}
}
@ -462,7 +462,7 @@ void WebView::slotTitleChanged(const QString &title)
if (!isVisible() && !isLoading() && !m_backgroundActivity) {
m_backgroundActivity = true;
emit backgroundActivityChanged(m_backgroundActivity);
Q_EMIT backgroundActivityChanged(m_backgroundActivity);
}
}
@ -661,7 +661,7 @@ void WebView::showEvent(QShowEvent *event)
if (m_backgroundActivity) {
m_backgroundActivity = false;
emit backgroundActivityChanged(m_backgroundActivity);
Q_EMIT backgroundActivityChanged(m_backgroundActivity);
}
}
@ -1228,7 +1228,7 @@ void WebView::_contextMenuEvent(QContextMenuEvent *event)
void WebView::resizeEvent(QResizeEvent *event)
{
QWebEngineView::resizeEvent(event);
emit viewportResized(size());
Q_EMIT viewportResized(size());
}
void WebView::contextMenuEvent(QContextMenuEvent *event)
@ -1349,7 +1349,7 @@ bool WebView::eventFilter(QObject *obj, QEvent *event)
switch (event->type()) {
case QEvent::FocusIn:
case QEvent::FocusOut:
emit focusChanged(hasFocus());
Q_EMIT focusChanged(hasFocus());
break;
default:

View File

@ -117,10 +117,10 @@ void TabbedWebView::setIp(const QHostInfo &info)
return;
}
m_currentIp = QString("%1 (%2)").arg(info.hostName(), info.addresses().at(0).toString());
m_currentIp = QStringLiteral("%1 (%2)").arg(info.hostName(), info.addresses().at(0).toString());
if (m_webTab->isCurrentTab()) {
emit ipChanged(m_currentIp);
Q_EMIT ipChanged(m_currentIp);
}
}
@ -148,7 +148,7 @@ QWidget* TabbedWebView::overlayWidget()
void TabbedWebView::closeView()
{
emit wantsCloseTab(tabIndex());
Q_EMIT wantsCloseTab(tabIndex());
}
void TabbedWebView::loadInNewTab(const LoadRequest &req, Qz::NewTabPositionFlags position)

View File

@ -333,7 +333,7 @@ void WebTab::detach()
if (m_isCurrentTab) {
m_isCurrentTab = false;
emit currentTabChanged(m_isCurrentTab);
Q_EMIT currentTabChanged(m_isCurrentTab);
}
m_tabBar->disconnect(this);
@ -357,7 +357,7 @@ void WebTab::attach(BrowserWindow* window)
const bool wasCurrent = m_isCurrentTab;
m_isCurrentTab = index == tabIndex();
if (wasCurrent != m_isCurrentTab) {
emit currentTabChanged(m_isCurrentTab);
Q_EMIT currentTabChanged(m_isCurrentTab);
}
};
@ -401,7 +401,7 @@ void WebTab::load(const LoadRequest &request)
void WebTab::unload()
{
m_savedTab = SavedTab(this);
emit restoredChanged(isRestored());
Q_EMIT restoredChanged(isRestored());
m_webView->setPage(new WebPage);
m_webView->setFocus();
}
@ -427,7 +427,7 @@ void WebTab::setPinned(bool state)
}
m_isPinned = state;
emit pinnedChanged(m_isPinned);
Q_EMIT pinnedChanged(m_isPinned);
}
bool WebTab::isMuted() const
@ -485,7 +485,7 @@ void WebTab::setParentTab(WebTab *tab)
const int index = m_parentTab->m_childTabs.indexOf(this);
if (index >= 0) {
m_parentTab->m_childTabs.removeAt(index);
emit m_parentTab->childTabRemoved(this, index);
Q_EMIT m_parentTab->childTabRemoved(this, index);
}
}
@ -495,7 +495,7 @@ void WebTab::setParentTab(WebTab *tab)
m_parentTab = nullptr;
tab->addChildTab(this);
} else {
emit parentTabChanged(m_parentTab);
Q_EMIT parentTabChanged(m_parentTab);
}
}
@ -511,7 +511,7 @@ void WebTab::addChildTab(WebTab *tab, int index)
const int index = oldParent->m_childTabs.indexOf(tab);
if (index >= 0) {
oldParent->m_childTabs.removeAt(index);
emit oldParent->childTabRemoved(tab, index);
Q_EMIT oldParent->childTabRemoved(tab, index);
}
}
@ -525,9 +525,9 @@ void WebTab::addChildTab(WebTab *tab, int index)
}
m_childTabs.insert(index, tab);
emit childTabAdded(tab, index);
Q_EMIT childTabAdded(tab, index);
emit tab->parentTabChanged(this);
Q_EMIT tab->parentTabChanged(this);
}
QVector<WebTab*> WebTab::childTabs() const
@ -559,7 +559,7 @@ void WebTab::restoreTab(const WebTab::SavedTab &tab)
if (!isPinned() && qzSettings->loadTabsOnActivation) {
m_savedTab = tab;
emit restoredChanged(isRestored());
Q_EMIT restoredChanged(isRestored());
int index = tabIndex();
m_tabBar->setTabText(index, tab.title);
@ -639,7 +639,7 @@ void WebTab::tabActivated()
}
p_restoreTab(m_savedTab);
m_savedTab.clear();
emit restoredChanged(isRestored());
Q_EMIT restoredChanged(isRestored());
});
}

View File

@ -54,7 +54,7 @@ void GM_Downloader::scriptDownloaded()
if (m_reply->error() != QNetworkReply::NoError) {
qWarning() << "GreaseMonkey: Cannot download script" << m_reply->errorString();
emit error();
Q_EMIT error();
return;
}
@ -62,7 +62,7 @@ void GM_Downloader::scriptDownloaded()
if (!response.contains(QByteArray("// ==UserScript=="))) {
qWarning() << "GreaseMonkey: Script does not contain UserScript header" << m_reply->request().url();
emit error();
Q_EMIT error();
return;
}
@ -75,14 +75,14 @@ void GM_Downloader::scriptDownloaded()
if (!file.open(QFile::WriteOnly)) {
qWarning() << "GreaseMonkey: Cannot open file for writing" << m_fileName;
emit error();
Q_EMIT error();
return;
}
file.write(response);
file.close();
emit finished(m_fileName);
Q_EMIT finished(m_fileName);
}
void GM_Downloader::requireDownloaded()
@ -93,13 +93,13 @@ void GM_Downloader::requireDownloaded()
m_reply->deleteLater();
if (m_reply != qobject_cast<QNetworkReply*>(sender())) {
emit error();
Q_EMIT error();
return;
}
if (m_reply->error() != QNetworkReply::NoError) {
qWarning() << "GreaseMonkey: Cannot download require script" << m_reply->errorString();
emit error();
Q_EMIT error();
return;
}
@ -107,7 +107,7 @@ void GM_Downloader::requireDownloaded()
if (response.isEmpty()) {
qWarning() << "GreaseMonkey: Empty script downloaded" << m_reply->request().url();
emit error();
Q_EMIT error();
return;
}
@ -135,7 +135,7 @@ void GM_Downloader::requireDownloaded()
if (!file.open(QFile::WriteOnly)) {
qWarning() << "GreaseMonkey: Cannot open file for writing" << m_fileName;
emit error();
Q_EMIT error();
return;
}
@ -144,5 +144,5 @@ void GM_Downloader::requireDownloaded()
settings.setValue(m_reply->request().url().toString(), QFileInfo(m_fileName).fileName());
emit finished(m_fileName);
Q_EMIT finished(m_fileName);
}

View File

@ -197,7 +197,7 @@ bool GM_Manager::addScript(GM_Script* script)
QWebEngineScriptCollection *collection = mApp->webProfile()->scripts();
collection->insert(script->webScript());
emit scriptsChanged();
Q_EMIT scriptsChanged();
return true;
}
@ -219,7 +219,7 @@ bool GM_Manager::removeScript(GM_Script* script, bool removeFile)
delete script;
}
emit scriptsChanged();
Q_EMIT scriptsChanged();
return true;
}

View File

@ -160,17 +160,17 @@ void GM_Script::updateScript()
return;
m_updating = true;
emit updatingChanged(m_updating);
Q_EMIT updatingChanged(m_updating);
auto *downloader = new GM_Downloader(m_downloadUrl, m_manager);
downloader->updateScript(m_fileName);
connect(downloader, &GM_Downloader::finished, this, [this]() {
m_updating = false;
emit updatingChanged(m_updating);
Q_EMIT updatingChanged(m_updating);
});
connect(downloader, &GM_Downloader::error, this, [this]() {
m_updating = false;
emit updatingChanged(m_updating);
Q_EMIT updatingChanged(m_updating);
});
downloadRequires();
}
@ -315,7 +315,7 @@ void GM_Script::reloadScript()
m_manager->removeScript(this, false);
m_manager->addScript(this);
emit scriptChanged();
Q_EMIT scriptChanged();
}
void GM_Script::downloadIcon()

View File

@ -33,12 +33,12 @@ GM_SettingsListWidget::GM_SettingsListWidget(QWidget* parent)
void GM_SettingsListWidget::mousePressEvent(QMouseEvent* event)
{
if (containsRemoveIcon(event->pos())) {
emit removeItemRequested(itemAt(event->pos()));
Q_EMIT removeItemRequested(itemAt(event->pos()));
return;
}
if (containsUpdateIcon(event->pos())) {
emit updateItemRequested(itemAt(event->pos()));
Q_EMIT updateItemRequested(itemAt(event->pos()));
return;
}

View File

@ -48,7 +48,7 @@ QjtMouseGesture::~QjtMouseGesture()
void QjtMouseGesture::emitGestured()
{
emit(gestured());
Q_EMIT(gestured());
}
const DirectionList QjtMouseGesture::directions() const

View File

@ -513,7 +513,7 @@ void TabManagerWidget::changeGroupType()
delayedRefreshTree();
emit groupTypeChanged(m_groupType);
Q_EMIT groupTypeChanged(m_groupType);
}
}
}
@ -944,7 +944,7 @@ bool TabTreeWidget::dropMimeData(QTreeWidgetItem *parent, int index, const QMime
targetWindow->tabWidget()->tabBar()->moveTab(webTab->tabIndex(), index);
if (!webTab->isCurrentTab())
emit requestRefreshTree();
Q_EMIT requestRefreshTree();
}
else {
return false;

View File

@ -158,7 +158,7 @@ TabManagerWidget* TabManagerWidgetController::createTabManagerWidget(BrowserWind
connect(tabManagerWidget, SIGNAL(groupTypeChanged(TabManagerWidget::GroupType)), this, SLOT(setGroupType(TabManagerWidget::GroupType)));
connect(this, SIGNAL(requestRefreshTree(WebPage*)), tabManagerWidget, SLOT(delayedRefreshTree(WebPage*)));
emit requestRefreshTree();
Q_EMIT requestRefreshTree();
return tabManagerWidget;
}
@ -193,7 +193,7 @@ void TabManagerWidgetController::mainWindowDeleted(BrowserWindow* window)
{
removeStatusBarIcon(window);
emit requestRefreshTree();
Q_EMIT requestRefreshTree();
}
void TabManagerWidgetController::raiseTabManager()
@ -233,7 +233,7 @@ void TabManagerWidgetController::showSideBySide()
void TabManagerWidgetController::emitRefreshTree()
{
emit requestRefreshTree();
Q_EMIT requestRefreshTree();
}
#include "tabmanagerwidgetcontroller.moc"

View File

@ -75,6 +75,6 @@ void LoadingAnimator::updatePixmap(LoadingAnimation *animation)
m_indexes.remove(animation);
m_animations.remove(index);
} else {
emit updateIndex(index);
Q_EMIT updateIndex(index);
}
}

View File

@ -119,7 +119,7 @@ void VerticalTabsPlugin::setViewType(ViewType type)
QSettings settings(m_settingsPath, QSettings::IniFormat);
settings.setValue(QSL("VerticalTabs/ViewType"), m_viewType);
emit viewTypeChanged(m_viewType);
Q_EMIT viewTypeChanged(m_viewType);
}
bool VerticalTabsPlugin::replaceTabBar() const
@ -212,5 +212,5 @@ void VerticalTabsPlugin::loadStyleSheet(const QString &theme)
}
m_styleSheet = QString::fromUtf8(file.readAll());
emit styleSheetChanged(m_styleSheet);
Q_EMIT styleSheetChanged(m_styleSheet);
}