//Created by Mateusz Półrola
#include "XdxfSettingsDialog.h"
+#include <QDebug>
XdxfSettingsDialog::XdxfSettingsDialog(XdxfPlugin *plugin, QWidget *parent) :
QDialog(parent)
settings->setValue(key, plugin->settings()->value(key));
settings->setValue("path", settingsDialog.dicitonaryFilePath());
+ qDebug()<<settingsDialog.generateCache();
if(settingsDialog.generateCache()) {
settings->setValue("generateCache", "true");
}
settings->value("generateCache") == "true") {
makeCache("");
}
+ else {
+ _settings->setValue("cached", "false");
+ }
emit settingsChanged();
}
timer.start();
countWords();
+ int lastProg = -1;
+
counter=0;
while (!reader.atEnd() && !stopped) {
cur.exec();
counter++;
int prog = counter*100/_wordsCount;
- if(prog % 5 == 0)
- Q_EMIT updateCachingProgress(prog);
+ if(prog % 5 == 0 && lastProg != prog) {
+ Q_EMIT updateCachingProgress(prog,
+ timer.restart());
+ lastProg = prog;
+ }
}
}
void stop();
Q_SIGNALS:
- //! emited with percent count of caching progress
- void updateCachingProgress(int);
+ //! emited with percent count of caching progress, and time elapsed from
+ //! last signal emit
+ void updateCachingProgress(int, int);
protected: