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

Commit

Permalink
Replaces return"" by return QString()
Browse files Browse the repository at this point in the history
It's faster and cleaner.
        QString().isEmpty();            // returns true
        QString().isNull();             // returns true
So replacing "" by QString() will not brake existing code.

Signed-off-by: Luís Pereira <luis.artur.pereira@gmail.com>
  • Loading branch information
luis-pereira committed Dec 27, 2011
1 parent 3f7785d commit e782dca
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 13 deletions.
8 changes: 4 additions & 4 deletions libraries/qtxdg/xdgdesktopfile.cpp
Expand Up @@ -804,7 +804,7 @@ QString expandDynamicUrl(QString url)
QString XdgDesktopFile::url() const
{
if (type() != LinkType)
return "";
return QString();

QString url;

Expand All @@ -817,7 +817,7 @@ QString XdgDesktopFile::url() const
if (!url.isEmpty())
return url;

return "";
return QString();
}


Expand Down Expand Up @@ -846,7 +846,7 @@ QString findDesktopFile(const QString& dirName, const QString& desktopName)
}
}

return "";
return QString();
}


Expand All @@ -865,7 +865,7 @@ QString findDesktopFile(const QString& desktopName)
return f;
}

return "";
return QString();
}


Expand Down
2 changes: 1 addition & 1 deletion libraries/qtxdg/xdgmenu.cpp
Expand Up @@ -751,7 +751,7 @@ QString XdgMenu::getMenuFileName(const QString& baseName)
}


return "";
return QString();
}


Expand Down
2 changes: 1 addition & 1 deletion libraries/razormount/diskmonitor.cpp
Expand Up @@ -99,7 +99,7 @@ QString DiskInfo::iconName() const
else if (raw_info["DKD_PRESENTATION_ICON_NAME"] == "multimedia-player")
return "multimedia-player";

return "";
return QString();
}

DiskMonitor::DiskMonitor(QObject *parent) : QThread(parent)
Expand Down
10 changes: 5 additions & 5 deletions libraries/razorqt/razorsettings.cpp
Expand Up @@ -120,7 +120,7 @@ QString findFile(const QString& fileName, bool onlyGlobal = false)
return file;
}

return "";
return QString();
}


Expand Down Expand Up @@ -287,7 +287,7 @@ QString RazorTheme::qss(const QString& module) const
return d->loadQss(path);

qWarning() << "QSS file cannot be found in any location:" << QString("%1/%2.qss").arg(d->mThemeName, module);
return "";
return QString();
}


Expand All @@ -300,14 +300,14 @@ QString RazorThemePrivate::loadQss(const QString& qssFile) const
if (! f.open(QIODevice::ReadOnly | QIODevice::Text))
{
qWarning() << "Theme: Canot open file for reading:" << qssFile;
return "";
return QString();
}

QString qss = f.readAll();
f.close();

if (qss.isEmpty())
return "";
return QString();

// handle relative paths
QString qssDir = QFileInfo(qssFile).canonicalPath();
Expand All @@ -326,7 +326,7 @@ QString RazorTheme::desktopBackground(int screen) const
QString wallpapperCfgFileName = findFile(QString("themes/%1/wallpapper.cfg").arg(d->mThemeName));

if (wallpapperCfgFileName.isEmpty())
return "";
return QString();

QSettings s(wallpapperCfgFileName, QSettings::IniFormat);
QString themeDir = QFileInfo(wallpapperCfgFileName).absolutePath();
Expand Down
2 changes: 1 addition & 1 deletion razorqt-panel/panel/razorpanel.cpp
Expand Up @@ -100,7 +100,7 @@ QString positionToStr(RazorPanel::Position position)
case RazorPanel::PositionBottom: return QString("Bottom");
}

return "";
return QString();
}


Expand Down
2 changes: 1 addition & 1 deletion razorqt-session/src/wmselectdialog.cpp
Expand Up @@ -64,7 +64,7 @@ QString WmSelectDialog::windowManager() const
if (item)
return item->data(Qt::UserRole).toString();

return "";
return QString();
}

void WmSelectDialog::addWindowManager(const QString &program, const QString &description)
Expand Down

0 comments on commit e782dca

Please sign in to comment.