Skip to content
This repository has been archived by the owner on Dec 17, 2017. It is now read-only.

Commit

Permalink
Fixed issue #492 "razor-qt creates a bunch of directories all over $H…
Browse files Browse the repository at this point in the history
…OME upon first launch"

(cherry picked from commit 9a28df2)
  • Loading branch information
SokoloffA authored and amoskvin committed Dec 21, 2012
1 parent 0d34cfb commit 73dea0d
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions razorqt-confupdate/rzupdate.cpp
Expand Up @@ -253,6 +253,7 @@ void RzUpdate::checkGotFile(const QString &_file, const QString &id)
file = _file.mid(i + 1).trimmed(); file = _file.mid(i + 1).trimmed();
} }


file=expandConfigFileName(file);
// qDebug("File %s, id %s", file.toLatin1().constData(), id.toLatin1().constData()); // qDebug("File %s, id %s", file.toLatin1().constData(), id.toLatin1().constData());


QSettings cfg(file, QSettings::IniFormat); QSettings cfg(file, QSettings::IniFormat);
Expand Down Expand Up @@ -317,7 +318,7 @@ bool RzUpdate::updateFile(const QString &filename)
while (!ts.atEnd()) { while (!ts.atEnd()) {
m_line = ts.readLine().trimmed(); m_line = ts.readLine().trimmed();
m_lineCount++; m_lineCount++;
log() << m_line; log() << m_line << "\n";
if (m_line.isEmpty() || (m_line[0] == '#')) if (m_line.isEmpty() || (m_line[0] == '#'))
{ {
continue; continue;
Expand Down Expand Up @@ -461,7 +462,7 @@ void RzUpdate::gotFile(const QString &_file)
// Reset group // Reset group
gotGroup(QString()); gotGroup(QString());


if (!m_oldFile.isEmpty()) if (!m_oldFile.isEmpty() && !m_skip && !m_skipFile)
{ {
QStringList ids = m_oldConfig->value(UPDATE_INFO_KEY).toStringList(); QStringList ids = m_oldConfig->value(UPDATE_INFO_KEY).toStringList();
QString cfg_id = m_currentFilename + ':' + m_id; QString cfg_id = m_currentFilename + ':' + m_id;
Expand All @@ -485,7 +486,7 @@ void RzUpdate::gotFile(const QString &_file)
m_oldFile.clear(); m_oldFile.clear();
} }


if (!m_newFile.isEmpty()) if (!m_newFile.isEmpty() && !m_skip && !m_skipFile)
{ {
// Close new file. // Close new file.
QStringList ids = m_newConfig->value(UPDATE_INFO_KEY).toStringList(); QStringList ids = m_newConfig->value(UPDATE_INFO_KEY).toStringList();
Expand Down Expand Up @@ -527,7 +528,8 @@ void RzUpdate::gotFile(const QString &_file)
{ {
m_skip = true; m_skip = true;
m_newFile.clear(); m_newFile.clear();
log() << m_currentFilename << ": Skipping update '" << m_id << "'" << endl; log() << m_currentFilename << ": Skipping update '" << m_id << "' old file "
<< m_oldConfig->fileName() << " already contains signature" << endl;
} }


if (!m_newFile.isEmpty()) if (!m_newFile.isEmpty())
Expand All @@ -537,7 +539,9 @@ void RzUpdate::gotFile(const QString &_file)
if (ids.contains(cfg_id)) if (ids.contains(cfg_id))
{ {
m_skip = true; m_skip = true;
log() << m_currentFilename << ": Skipping update '" << m_id << "'" << endl; log() << m_currentFilename << ": Skipping update '" << m_id << "' new file "
<< m_newConfig->fileName() << " already contains signature" << endl;

} }
} }
else else
Expand Down

0 comments on commit 73dea0d

Please sign in to comment.