]> git.lyx.org Git - features.git/commitdiff
Use one place to generate current time string, increase resolution to ms
authorPeter Kümmel <syntheticpp@gmx.net>
Sun, 7 Mar 2010 11:55:14 +0000 (11:55 +0000)
committerPeter Kümmel <syntheticpp@gmx.net>
Sun, 7 Mar 2010 11:55:14 +0000 (11:55 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@33662 a592a061-630c-0410-9148-cb99ea01b6c8

src/frontends/qt4/GuiProgress.cpp
src/frontends/qt4/GuiProgress.h
src/frontends/qt4/GuiProgressView.cpp

index 4fa8a134909a80fd80089788f7aa13d54b2ada3d..bda9974247269c64813a2c67f696f8c85af335b3 100644 (file)
@@ -61,17 +61,21 @@ GuiProgress::GuiProgress()
 }
 
 
+QString GuiProgress::currentTime()
+{
+       return QTime::currentTime().toString("hh:mm:ss:zzz") + "ms";
+}
+
+
 void GuiProgress::doProcessStarted(QString const & cmd)
 {
-       QString time = QTime::currentTime().toString();
-       appendText(time + ": <" + cmd + "> started");
+       appendText(currentTime() + ": <" + cmd + "> started");
 }
 
 
 void GuiProgress::doProcessFinished(QString const & cmd)
 {
-       QString time = QTime::currentTime().toString();
-       appendText(time + ": <" + cmd + "> done");
+       appendText(currentTime() + ": <" + cmd + "> done");
 }
 
 
index 5248dcc40b5a88f33155cb25c59fc121ca82570b..49f1e2b4b887f4017ccd2ef0c40b8974779855ec 100644 (file)
@@ -41,6 +41,8 @@ public:
        void lyxerrConnect();
        void lyxerrDisconnect();
        void lyxerrFlush();
+        
+        static QString currentTime();
 
 Q_SIGNALS:
 
@@ -77,7 +79,7 @@ private Q_SLOTS:
 
 private:
        void appendText(QString const &);
-       std::ostringstream lyxerr_stream_;
+       std::ostringstream lyxerr_stream_;      
 };
 
 
index 5aafbda598a44b238eca1d669c2b605b9859b472..a608c53442b93b6bd8a7b154acf4b14f7b54b45b 100644 (file)
@@ -190,7 +190,7 @@ void GuiProgressView::appendText(QString const & text)
 {
        if (text.isEmpty() || !widget_->sbarCB->isChecked())
                return;
-       QString str = QTime::currentTime().toString();
+       QString str = GuiProgress::currentTime();
        str += ": " + text;
        if (!text.endsWith("\n"))
                str += "\n";