Remove some warnings

Unused variables
Unused code
Unused arguments
Unnecessarily complex code
Initialization order
Duplicated properties

REVIEW: 127214
This commit is contained in:
Aleix Pol 2016-02-29 00:59:44 +01:00
parent 9f62532674
commit 06c7b9c050
9 changed files with 20 additions and 30 deletions

View File

@ -38,9 +38,9 @@ bool buildonly = true;
void PluginTest::listEngines()
{
KPluginInfo::List plugins = Plasma::PluginLoader::listEngineInfo();
foreach (const KPluginInfo& info, plugins) {
// foreach (const KPluginInfo& info, plugins) {
//qDebug() << " Found DataEngine: " << info.pluginName() << info.name();
}
// }
qDebug() << " Found " << plugins.count() << " DataEngines";
QVERIFY(plugins.count() > 0 || buildonly);
}

View File

@ -28,8 +28,8 @@
DaysModel::DaysModel(QObject *parent) :
QAbstractListModel(parent),
m_agendaNeedsUpdate(false),
m_pluginsManager(0)
m_pluginsManager(0),
m_agendaNeedsUpdate(false)
{
QHash<int, QByteArray> roleNames;

View File

@ -127,8 +127,6 @@ private:
EventPluginsManager::EventPluginsManager(QObject *parent)
: QObject(parent)
{
QString pluginPath;
// First of all get a list of available plugins
// and get their metadata. This alone is enough
// for the applet config to work

View File

@ -54,7 +54,6 @@ class QuickTheme : public Plasma::Theme
Q_PROPERTY(QColor buttonBackgroundColor READ buttonBackgroundColor NOTIFY themeChangedProxy)
Q_PROPERTY(QColor linkColor READ linkColor NOTIFY themeChangedProxy)
Q_PROPERTY(QColor visitedLinkColor READ visitedLinkColor NOTIFY themeChangedProxy)
Q_PROPERTY(QColor visitedLinkColor READ visitedLinkColor NOTIFY themeChangedProxy)
Q_PROPERTY(QColor buttonHoverColor READ buttonHoverColor NOTIFY themeChangedProxy)
Q_PROPERTY(QColor buttonFocusColor READ buttonFocusColor NOTIFY themeChangedProxy)
Q_PROPERTY(QColor viewTextColor READ viewTextColor NOTIFY themeChangedProxy)

View File

@ -26,8 +26,8 @@
#include <QCoreApplication>
Application::Private::Private(Application *parent)
: q(parent),
running(false)
: running(false)
, q(parent)
{
connect(
&process, SIGNAL(stateChanged(QProcess::ProcessState)),
@ -42,12 +42,14 @@ Application::Private::Private(Application *parent)
void Application::Private::stateChanged(QProcess::ProcessState newState)
{
Q_UNUSED(newState)
//running = (newState != QProcess::NotRunning);
//q->runningChanged(running);
}
void Application::Private::errorFound(QProcess::ProcessError err)
{
Q_UNUSED(err)
qWarning() << "Error" << process.error() << "while starting" << application;
}

View File

@ -184,7 +184,6 @@ void AppletPrivate::init(const QString &packagePath, const QVariantList &args)
}
if (!q->isContainment() && q->pluginInfo().isValid()) {
QString constraint;
QStringList provides = q->pluginInfo().property(QStringLiteral("X-Plasma-Provides")).toStringList();
if (!provides.isEmpty()) {
auto filter = [&provides](const KPluginMetaData &md) -> bool

View File

@ -126,12 +126,8 @@ ThemePrivate::ThemePrivate(QObject *parent)
ThemePrivate::~ThemePrivate()
{
saveSvgElementsCache();
if (FrameSvgPrivate::s_sharedFrames.contains(this)) {
foreach (FrameData *data, FrameSvgPrivate::s_sharedFrames[this].values()) {
delete data;
}
FrameSvgPrivate::s_sharedFrames.remove(this);
}
QHash<QString, FrameData*> data = FrameSvgPrivate::s_sharedFrames.take(this);
qDeleteAll(data);
delete pixmapCache;
}

View File

@ -70,7 +70,7 @@ QString Service::destination() const
QStringList Service::operationNames() const
{
if (d->operationsMap.keys().isEmpty()) {
if (d->operationsMap.isEmpty()) {
#ifndef NDEBUG
// qCDebug(LOG_PLASMA) << "No valid operations scheme has been registered";
#endif
@ -82,7 +82,7 @@ QStringList Service::operationNames() const
QVariantMap Service::operationDescription(const QString &operationName)
{
if (d->operationsMap.keys().isEmpty()) {
if (d->operationsMap.isEmpty()) {
#ifndef NDEBUG
// qCDebug(LOG_PLASMA) << "No valid operations scheme has been registered";
#endif
@ -100,7 +100,7 @@ ServiceJob *Service::startOperationCall(const QVariantMap &description, QObject
ServiceJob *job = 0;
const QString op = !description.isEmpty() ? description.value(QStringLiteral("_name")).toString() : QString();
if (d->operationsMap.keys().isEmpty()) {
if (d->operationsMap.isEmpty()) {
#ifndef NDEBUG
// qCDebug(LOG_PLASMA) << "No valid operations scheme has been registered";
#endif
@ -147,7 +147,7 @@ void Service::setName(const QString &name)
void Service::setOperationEnabled(const QString &operation, bool enable)
{
if (d->operationsMap.keys().isEmpty() || !d->operationsMap.contains(operation)) {
if (d->operationsMap.isEmpty() || !d->operationsMap.contains(operation)) {
return;
}
@ -186,7 +186,7 @@ void Service::setOperationsScheme(QIODevice *xml)
void Service::registerOperationsScheme()
{
if (!d->operationsMap.keys().isEmpty()) {
if (!d->operationsMap.isEmpty()) {
// we've already done our job. let's go home.
return;
}

View File

@ -113,7 +113,6 @@ void PlasmaPkg::runMain()
}
QString type = d->parser->value(QStringLiteral("type"));
QString packageRoot = type;
d->pluginTypes.clear();
d->installer = 0;
@ -334,15 +333,10 @@ void PlasmaPkg::runMain()
}
QStringList installed = d->packages(d->pluginTypes);
const QString file = QDir::currentPath() + '/' + pluginName;
if (QFile::exists(d->packageFile)) {
const QString file = QDir::currentPath() + '/' + d->package;
d->installer->setPath(d->packageFile);
if (d->installer->isValid()) {
if (d->installer->metadata().isValid()) {
pluginName = d->installer->metadata().pluginName();
}
if (d->installer->isValid() && d->installer->metadata().isValid()) {
pluginName = d->installer->metadata().pluginName();
}
}
// Uninstalling ...
@ -485,6 +479,8 @@ void PlasmaPkg::showPackageInfo(const QString &pluginName)
QString PlasmaPkg::findPackageRoot(const QString &pluginName, const QString &prefix)
{
Q_UNUSED(pluginName)
Q_UNUSED(prefix)
QString packageRoot;
if (d->parser->isSet(QStringLiteral("packageroot")) && d->parser->isSet(QStringLiteral("global"))) {
qWarning() << i18nc("The user entered conflicting options packageroot and global, this is the error message telling the user he can use only one", "The packageroot and global options conflict each other, please select only one.");
@ -616,7 +612,7 @@ void PlasmaPkgPrivate::listTypes()
#pragma message("read config here")
// structure.read(&config);
// get the name based on the rc file name, just as Plasma::PackageStructure does
const QString name = file.left(file.length() - 2);
// const QString name = file.left(file.length() - 2);
//plugins.insert(name, QStringList() << structure.type() << structure.defaultPackageRoot());
}
}