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

Use Q_EMIT

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