some refactoring

* fix undefinded behaviour
* drop dbus timout, use generic timeout insead
* drop load source to own cmake key
* update contributing.md
This commit is contained in:
2016-06-30 01:59:06 +03:00
parent 5cd5272f10
commit 8e8ac2f3c7
15 changed files with 75 additions and 65 deletions

View File

@ -38,8 +38,8 @@ bool AWKeyCache::addKeyToCache(const QString type, const QString key)
cache.beginGroup(type);
QStringList cachedValues;
for (auto key : cache.allKeys())
cachedValues.append(cache.value(key).toString());
for (auto number : cache.allKeys())
cachedValues.append(cache.value(number).toString());
if (type == QString("hdd")) {
QStringList allDevices
@ -51,6 +51,7 @@ bool AWKeyCache::addKeyToCache(const QString type, const QString key)
if (cachedValues.contains(device))
continue;
qCInfo(LOG_AW) << "Found new key" << device << "for type" << type;
cachedValues.append(device);
cache.setValue(
QString("%1").arg(cache.allKeys().count(), 3, 10, QChar('0')),
device);
@ -63,6 +64,7 @@ bool AWKeyCache::addKeyToCache(const QString type, const QString key)
if (cachedValues.contains(device))
continue;
qCInfo(LOG_AW) << "Found new key" << device << "for type" << type;
cachedValues.append(device);
cache.setValue(
QString("%1").arg(cache.allKeys().count(), 3, 10, QChar('0')),
device);