Commit b91c0f64 authored by Laurent Montel's avatar Laurent Montel 😁

Use Q_EMIT

parent 5f0506ed
...@@ -104,7 +104,7 @@ void HistoryCollection::pop() //slot ...@@ -104,7 +104,7 @@ void HistoryCollection::pop() //slot
m_receiver = (sender() == m_b) ? m_f : m_b; m_receiver = (sender() == m_b) ? m_f : m_b;
emit activated(url); Q_EMIT activated(url);
} }
void HistoryCollection::save(KConfigGroup &configgroup) void HistoryCollection::save(KConfigGroup &configgroup)
......
...@@ -91,7 +91,7 @@ LocalLister::run() ...@@ -91,7 +91,7 @@ LocalLister::run()
tree = nullptr; tree = nullptr;
} }
qCDebug(FILELIGHT_LOG) << "Emitting signal to cache results ..."; qCDebug(FILELIGHT_LOG) << "Emitting signal to cache results ...";
emit branchCompleted(tree); Q_EMIT branchCompleted(tree);
qCDebug(FILELIGHT_LOG) << "Thread terminating ..."; qCDebug(FILELIGHT_LOG) << "Thread terminating ...";
} }
......
...@@ -467,8 +467,8 @@ bool MainWindow::start(const QUrl &url) ...@@ -467,8 +467,8 @@ bool MainWindow::start(const QUrl &url)
const QString s = i18n("Scanning: %1", prettyUrl()); const QString s = i18n("Scanning: %1", prettyUrl());
stateChanged(QStringLiteral("scan_started")); stateChanged(QStringLiteral("scan_started"));
emit started(); //as a MainWindow, we have to do this Q_EMIT started(); //as a MainWindow, we have to do this
emit setWindowCaption(s); Q_EMIT setWindowCaption(s);
statusBar()->showMessage(s); statusBar()->showMessage(s);
m_map->hide(); m_map->hide();
m_map->invalidate(); //to maintain ui consistency m_map->invalidate(); //to maintain ui consistency
...@@ -508,8 +508,8 @@ void MainWindow::folderScanCompleted(Folder *tree) ...@@ -508,8 +508,8 @@ void MainWindow::folderScanCompleted(Folder *tree)
} }
else { else {
stateChanged(QStringLiteral("scan_failed")); stateChanged(QStringLiteral("scan_failed"));
emit canceled(i18n("Scan failed: %1", prettyUrl())); Q_EMIT canceled(i18n("Scan failed: %1", prettyUrl()));
emit setWindowCaption(QString()); Q_EMIT setWindowCaption(QString());
statusBar()->clearMessage(); statusBar()->clearMessage();
...@@ -526,7 +526,7 @@ void MainWindow::mapChanged(const Folder *tree) ...@@ -526,7 +526,7 @@ void MainWindow::mapChanged(const Folder *tree)
{ {
//IMPORTANT -> url() has already been set //IMPORTANT -> url() has already been set
emit setWindowCaption(prettyUrl()); Q_EMIT setWindowCaption(prettyUrl());
const int fileCount = tree->children(); const int fileCount = tree->children();
const QString text = (fileCount == 0) ? const QString text = (fileCount == 0) ?
......
...@@ -97,7 +97,7 @@ void RadialMap::Widget::invalidate() ...@@ -97,7 +97,7 @@ void RadialMap::Widget::invalidate()
update(); update();
//tell rest of Filelight //tell rest of Filelight
emit invalidated(invalidatedUrl); Q_EMIT invalidated(invalidatedUrl);
} }
} }
...@@ -124,7 +124,7 @@ RadialMap::Widget::create(const Folder *tree) ...@@ -124,7 +124,7 @@ RadialMap::Widget::create(const Folder *tree)
m_tree = tree; m_tree = tree;
//tell rest of Filelight //tell rest of Filelight
emit folderCreated(tree); Q_EMIT folderCreated(tree);
} }
void void
......
...@@ -146,7 +146,7 @@ void RadialMap::Widget::mouseMoveEvent(QMouseEvent *e) ...@@ -146,7 +146,7 @@ void RadialMap::Widget::mouseMoveEvent(QMouseEvent *e)
unsetCursor(); unsetCursor();
update(); update();
emit mouseHover(QString()); Q_EMIT mouseHover(QString());
} }
return; return;
...@@ -244,7 +244,7 @@ void RadialMap::Widget::mouseMoveEvent(QMouseEvent *e) ...@@ -244,7 +244,7 @@ void RadialMap::Widget::mouseMoveEvent(QMouseEvent *e)
m_tooltip.show(); m_tooltip.show();
emit mouseHover(m_focus->file()->displayPath()); Q_EMIT mouseHover(m_focus->file()->displayPath());
update(); update();
} }
...@@ -253,7 +253,7 @@ void RadialMap::Widget::enterEvent(QEvent *) ...@@ -253,7 +253,7 @@ void RadialMap::Widget::enterEvent(QEvent *)
if (!m_focus) return; if (!m_focus) return;
setCursor(Qt::PointingHandCursor); setCursor(Qt::PointingHandCursor);
emit mouseHover(m_focus->file()->displayPath()); Q_EMIT mouseHover(m_focus->file()->displayPath());
update(); update();
} }
...@@ -285,10 +285,10 @@ void RadialMap::Widget::mousePressEvent(QMouseEvent *e) ...@@ -285,10 +285,10 @@ void RadialMap::Widget::mousePressEvent(QMouseEvent *e)
if (e->button() == Qt::LeftButton) { if (e->button() == Qt::LeftButton) {
if (m_focus->file() != m_tree) { if (m_focus->file() != m_tree) {
emit activated(url); //activate first, this will cause UI to prepare itself Q_EMIT activated(url); //activate first, this will cause UI to prepare itself
createFromCache((Folder *)m_focus->file()); createFromCache((Folder *)m_focus->file());
} else if (KIO::upUrl(url) != url) { } else if (KIO::upUrl(url) != url) {
emit giveMeTreeFor(KIO::upUrl(url)); Q_EMIT giveMeTreeFor(KIO::upUrl(url));
} }
return; return;
...@@ -344,7 +344,7 @@ void RadialMap::Widget::mousePressEvent(QMouseEvent *e) ...@@ -344,7 +344,7 @@ void RadialMap::Widget::mousePressEvent(QMouseEvent *e)
} else if (openTerminal && clicked == openTerminal) { } else if (openTerminal && clicked == openTerminal) {
KToolInvocation::invokeTerminal(QString(),url.path()); KToolInvocation::invokeTerminal(QString(),url.path());
} else if (centerMap && clicked == centerMap) { } else if (centerMap && clicked == centerMap) {
emit activated(url); //activate first, this will cause UI to prepare itself Q_EMIT activated(url); //activate first, this will cause UI to prepare itself
createFromCache((Folder *)m_focus->file()); createFromCache((Folder *)m_focus->file());
} else if (openFile && clicked == openFile) { } else if (openFile && clicked == openFile) {
new KRun(url, this, true); new KRun(url, this, true);
...@@ -392,7 +392,7 @@ void RadialMap::Widget::dropEvent(QDropEvent *e) ...@@ -392,7 +392,7 @@ void RadialMap::Widget::dropEvent(QDropEvent *e)
{ {
QList<QUrl> uriList = KUrlMimeData::urlsFromMimeData(e->mimeData()); QList<QUrl> uriList = KUrlMimeData::urlsFromMimeData(e->mimeData());
if (!uriList.isEmpty()) if (!uriList.isEmpty())
emit giveMeTreeFor(uriList.first()); Q_EMIT giveMeTreeFor(uriList.first());
} }
void RadialMap::Widget::dragEnterEvent(QDragEnterEvent *e) void RadialMap::Widget::dragEnterEvent(QDragEnterEvent *e)
......
...@@ -101,7 +101,7 @@ RemoteLister::~RemoteLister() ...@@ -101,7 +101,7 @@ RemoteLister::~RemoteLister()
void RemoteLister::onCanceled() void RemoteLister::onCanceled()
{ {
qCDebug(FILELIGHT_LOG) << "Canceled"; qCDebug(FILELIGHT_LOG) << "Canceled";
emit branchCompleted(nullptr); Q_EMIT branchCompleted(nullptr);
deleteLater(); deleteLater();
} }
...@@ -153,7 +153,7 @@ void RemoteLister::onCompleted() ...@@ -153,7 +153,7 @@ void RemoteLister::onCompleted()
qCDebug(FILELIGHT_LOG) << "I think we're done"; qCDebug(FILELIGHT_LOG) << "I think we're done";
Q_ASSERT(m_root == m_store); Q_ASSERT(m_root == m_store);
emit branchCompleted(m_store->folder); Q_EMIT branchCompleted(m_store->folder);
deleteLater(); deleteLater();
} }
......
...@@ -141,14 +141,14 @@ bool ScanManager::start(const QUrl &url) ...@@ -141,14 +141,14 @@ bool ScanManager::start(const QUrl &url)
//we found a completed tree, thus no need to scan //we found a completed tree, thus no need to scan
qCDebug(FILELIGHT_LOG) << "Found cache-handle, generating map.."; qCDebug(FILELIGHT_LOG) << "Found cache-handle, generating map..";
emit branchCacheHit(d); Q_EMIT branchCacheHit(d);
return true; return true;
} else { } else {
//something went wrong, we couldn't find the folder we were expecting //something went wrong, we couldn't find the folder we were expecting
qCWarning(FILELIGHT_LOG) << "Didn't find " << path << " in the cache!\n"; qCWarning(FILELIGHT_LOG) << "Didn't find " << path << " in the cache!\n";
it.remove(); it.remove();
emit aboutToEmptyCache(); Q_EMIT aboutToEmptyCache();
delete folder; delete folder;
break; //do a full scan break; //do a full scan
} }
...@@ -193,7 +193,7 @@ void ScanManager::invalidateCacheFor(const QUrl &url) ...@@ -193,7 +193,7 @@ void ScanManager::invalidateCacheFor(const QUrl &url)
QString path = url.toLocalFile(); QString path = url.toLocalFile();
if (!path.endsWith(QDir::separator())) path += QDir::separator(); if (!path.endsWith(QDir::separator())) path += QDir::separator();
emit aboutToEmptyCache(); Q_EMIT aboutToEmptyCache();
QMutableListIterator<Folder*> it(m_cache); QMutableListIterator<Folder*> it(m_cache);
while (it.hasNext()) { while (it.hasNext()) {
...@@ -241,7 +241,7 @@ void ScanManager::emptyCache() ...@@ -241,7 +241,7 @@ void ScanManager::emptyCache()
m_thread->wait(); m_thread->wait();
} }
emit aboutToEmptyCache(); Q_EMIT aboutToEmptyCache();
qDeleteAll(m_cache); qDeleteAll(m_cache);
m_cache.clear(); m_cache.clear();
...@@ -259,7 +259,7 @@ void ScanManager::cacheTree(Folder *tree) ...@@ -259,7 +259,7 @@ void ScanManager::cacheTree(Folder *tree)
m_thread = nullptr; m_thread = nullptr;
} }
emit completed(tree); Q_EMIT completed(tree);
if (tree) { if (tree) {
//we don't cache foreign stuff //we don't cache foreign stuff
...@@ -276,7 +276,7 @@ void ScanManager::cacheTree(Folder *tree) ...@@ -276,7 +276,7 @@ void ScanManager::cacheTree(Folder *tree)
void ScanManager::foundCached(Folder *tree) void ScanManager::foundCached(Folder *tree)
{ {
emit completed(tree); Q_EMIT completed(tree);
QGuiApplication::restoreOverrideCursor(); QGuiApplication::restoreOverrideCursor();
} }
......
...@@ -206,41 +206,41 @@ void SettingsDialog::changeScheme(QAbstractButton *button) ...@@ -206,41 +206,41 @@ void SettingsDialog::changeScheme(QAbstractButton *button)
if (button) { if (button) {
const int s = m_schemaGroup->id(button); const int s = m_schemaGroup->id(button);
Config::scheme = (Filelight::MapScheme)s; Config::scheme = (Filelight::MapScheme)s;
emit canvasIsDirty(1); Q_EMIT canvasIsDirty(1);
} }
} }
void SettingsDialog::changeContrast(int c) void SettingsDialog::changeContrast(int c)
{ {
Config::contrast = c; Config::contrast = c;
emit canvasIsDirty(3); Q_EMIT canvasIsDirty(3);
} }
void SettingsDialog::toggleUseAntialiasing(bool b) void SettingsDialog::toggleUseAntialiasing(bool b)
{ {
Config::antialias = b; Config::antialias = b;
emit canvasIsDirty(2); Q_EMIT canvasIsDirty(2);
} }
void SettingsDialog::toggleVaryLabelFontSizes(bool b) void SettingsDialog::toggleVaryLabelFontSizes(bool b)
{ {
Config::varyLabelFontSizes = b; Config::varyLabelFontSizes = b;
minFontPitchLabel->setEnabled(b); minFontPitchLabel->setEnabled(b);
minFontPitch->setEnabled(b); minFontPitch->setEnabled(b);
emit canvasIsDirty(0); Q_EMIT canvasIsDirty(0);
} }
void SettingsDialog::changeMinFontPitch(int p) void SettingsDialog::changeMinFontPitch(int p)
{ {
Config::minFontPitch = p; Config::minFontPitch = p;
emit canvasIsDirty(0); Q_EMIT canvasIsDirty(0);
} }
void SettingsDialog::toggleShowSmallFiles(bool b) void SettingsDialog::toggleShowSmallFiles(bool b)
{ {
Config::showSmallFiles = b; Config::showSmallFiles = b;
emit canvasIsDirty(1); Q_EMIT canvasIsDirty(1);
} }
void SettingsDialog::slotSliderReleased() void SettingsDialog::slotSliderReleased()
{ {
emit canvasIsDirty(2); Q_EMIT canvasIsDirty(2);
} }
......
...@@ -84,7 +84,7 @@ public: ...@@ -84,7 +84,7 @@ public:
RadialMap::Widget::mousePressEvent(e); RadialMap::Widget::mousePressEvent(e);
} else if (e->button() == Qt::LeftButton) { } else if (e->button() == Qt::LeftButton) {
// and clicks to the used segment // and clicks to the used segment
emit activated(url()); Q_EMIT activated(url());
} }
} }
}; };
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment