* drop workspace.xml from source tree (it is changed too offen)

* fix export and import configurations for json files
This commit is contained in:
arcan1s 2015-10-19 00:57:27 +03:00
parent 17a8a1734b
commit c1a8c17ecb
4 changed files with 15 additions and 1046 deletions

1
.gitignore vendored
View File

@ -44,3 +44,4 @@ build
src
pkg
sources/.idea/workspace.xml

File diff suppressed because it is too large Load Diff

View File

@ -269,7 +269,7 @@ void AWConfigHelper::readFile(QSettings &settings, const QString key,
QFile file(fileName);
if (file.open(QIODevice::ReadOnly | QIODevice::Text)) {
QString text = QTextCodec::codecForMib(106)->toUnicode(file.readAll());
QString text = QString::fromUtf8(file.readAll());
file.close();
settings.setValue(key, text);
} else {
@ -331,14 +331,17 @@ void AWConfigHelper::writeFile(QSettings &settings, const QString key,
qCDebug(LOG_AW) << "Key" << key;
qCDebug(LOG_AW) << "File" << fileName;
if (settings.contains(key)) {
QFile file(fileName);
if (file.open(QIODevice::WriteOnly | QIODevice::Text)) {
QDataStream out(&file);
out << settings.value(key).toString().toUtf8();
file.close();
} else {
qCWarning(LOG_LIB) << "Could not open" << file.fileName();
}
if (!settings.contains(key))
return;
QFile file(fileName);
if (file.open(QIODevice::WriteOnly | QIODevice::Text)) {
QTextStream out(&file);
out.setCodec("UTF-8");
out << settings.value(key).toString().toUtf8();
out.flush();
file.close();
} else {
qCWarning(LOG_LIB) << "Could not open" << file.fileName();
}
}

View File

@ -69,8 +69,7 @@ void AWDataEngineAggregator::dropSource(const QString source)
qCDebug(LOG_AW) << "Source" << source;
// FIXME there is no possibility to check to which dataengine source
// connected
// we will try to disconnect it from systemmonitor and extsysmon
// connected we will try to disconnect it from systemmonitor and extsysmon
m_dataEngines[QString("systemmonitor")]->disconnectSource(source, parent());
m_dataEngines[QString("extsysmon")]->disconnectSource(source, parent());
}