mirror of
https://github.com/arcan1s/awesome-widgets.git
synced 2025-04-24 23:47:20 +00:00
* drop workspace.xml from source tree (it is changed too offen)
* fix export and import configurations for json files
This commit is contained in:
parent
17a8a1734b
commit
c1a8c17ecb
1
.gitignore
vendored
1
.gitignore
vendored
@ -44,3 +44,4 @@ build
|
||||
src
|
||||
pkg
|
||||
|
||||
sources/.idea/workspace.xml
|
||||
|
1034
sources/.idea/workspace.xml
generated
1034
sources/.idea/workspace.xml
generated
File diff suppressed because it is too large
Load Diff
@ -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();
|
||||
}
|
||||
}
|
||||
|
@ -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());
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user