[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [baloo] src/tools/balooctl: MonitorCommand: Use both the started and finished signals
From:       Vishesh Handa <me () vhanda ! in>
Date:       2015-10-10 16:52:56
Message-ID: E1ZkxOC-0000RL-7A () scm ! kde ! org
[Download RAW message or body]

Git commit 8f4dca00228b0e842bbcedd5bef12d733f2f60b7 by Vishesh Handa.
Committed on 10/10/2015 at 16:52.
Pushed by vhanda into branch 'master'.

MonitorCommand: Use both the started and finished signals

This is just an intermediate commit before we add extra output in the
middle to indicate that we are actually indexing the file right now.

M  +16   -6    src/tools/balooctl/monitorcommand.cpp
M  +3    -1    src/tools/balooctl/monitorcommand.h

http://commits.kde.org/baloo/8f4dca00228b0e842bbcedd5bef12d733f2f60b7

diff --git a/src/tools/balooctl/monitorcommand.cpp \
b/src/tools/balooctl/monitorcommand.cpp index 07bccb1..dfe26c1 100644
--- a/src/tools/balooctl/monitorcommand.cpp
+++ b/src/tools/balooctl/monitorcommand.cpp
@@ -41,17 +41,27 @@ MonitorCommand::MonitorCommand(QObject *parent)
         QCoreApplication::exit();
     }
     m_interface->registerMonitor();
-    connect(m_interface, &org::kde::baloo::fileindexer::startedIndexingFile, this, \
&MonitorCommand::newFile); +    connect(m_interface, \
&org::kde::baloo::fileindexer::startedIndexingFile, this, \
&MonitorCommand::startedIndexingFile); +    connect(m_interface, \
&org::kde::baloo::fileindexer::finishedIndexingFile, this, \
&MonitorCommand::finishedIndexingFile);  m_out << "Press ctrl+c to exit monitor" << \
endl;  }
 
-void MonitorCommand::newFile(const QString& url)
-{
-    m_out << "Indexing: " << url << endl;
-}
-
 int MonitorCommand::exec(const QCommandLineParser& parser)
 {
     Q_UNUSED(parser);
     return QCoreApplication::instance()->exec();
 }
+
+void MonitorCommand::startedIndexingFile(const QString& filePath)
+{
+    m_currentFile = filePath;
+    m_out << "Indexing: " << filePath;
+}
+
+void MonitorCommand::finishedIndexingFile(const QString& filePath)
+{
+    Q_UNUSED(filePath);
+
+    m_currentFile.clear();
+    m_out << endl;
+}
diff --git a/src/tools/balooctl/monitorcommand.h \
b/src/tools/balooctl/monitorcommand.h index 01123bc..72c5755 100644
--- a/src/tools/balooctl/monitorcommand.h
+++ b/src/tools/balooctl/monitorcommand.h
@@ -50,12 +50,14 @@ public:
     int exec(const QCommandLineParser& parser);
 
 private Q_SLOTS:
-    void newFile(const QString& url);
+    void startedIndexingFile(const QString& filePath);
+    void finishedIndexingFile(const QString& filePath);
 
 private:
     QTextStream m_out;
     org::kde::baloo::fileindexer* m_interface;
 
+    QString m_currentFile;
 };
 }
 #endif // MONITOR_H


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic