Skip to content

Commit

Permalink
fixed compiler warnings for depreciated QT functions
Browse files Browse the repository at this point in the history
  • Loading branch information
andrew-bibb committed Aug 3, 2020
1 parent e00ba60 commit 890da75
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 22 deletions.
4 changes: 2 additions & 2 deletions apps/cmstapp/code/control_box/controlbox.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ idButton::idButton(QWidget* parent, const QDBusObjectPath& id) :
QHBoxLayout* layout = new QHBoxLayout(this);
layout->setContentsMargins(m_left, m_top, m_right, m_bottom);
layout->setAlignment(Qt::AlignCenter);
layout->addWidget(button, 0, 0);
layout->addWidget(button, 0);

return;
}
Expand Down Expand Up @@ -3032,7 +3032,7 @@ void ControlBox::findConnmanVersion()
QProcess qps;
bool b_ok = false;

qps.start("connmand -v");
qps.start("connmand -v", QStringList());
qps.waitForFinished();
f_connmanversion = qps.readAllStandardOutput().toFloat(&b_ok);
if (! b_ok) f_connmanversion = -1.0;
Expand Down
44 changes: 25 additions & 19 deletions apps/cmstapp/code/iconman/iconman.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ DEALINGS IN THE SOFTWARE.
# include <QMessageBox>
# include <QProcessEnvironment>
# include <QDirIterator>
# include <QtGlobal>

// Constructor
IconManager::IconManager(QObject* parent) : QObject(parent)
Expand Down Expand Up @@ -72,22 +73,27 @@ IconManager::IconManager(QObject* parent) : QObject(parent)
QTextStream in(&f1);
QString line;
while (!in.atEnd()) {
line = in.readLine();
line = line.simplified();
if (line.startsWith("[icon]", Qt::CaseInsensitive) ) {
IconElement ie;
QString iconame;
do {
line = in.readLine();
if (line.startsWith("icon_name", Qt::CaseInsensitive) ) iconame = extractValue(line);
else if (line.startsWith("resource", Qt::CaseInsensitive) ) ie.resource_path = extractValue(line);
else if (line.startsWith("colorize", Qt::CaseInsensitive) ) ie.colorize = extractValue(line);
else if (line.startsWith("fdo_name", Qt::CaseInsensitive) ) ie.fdo_name = extractValue(line);
else if (line.startsWith("theme_names", Qt::CaseInsensitive) ) ie.theme_names = extractValue(line).split(',', QString::SkipEmptyParts) ;
} while ( ! line.isEmpty() );
icon_map[iconame] = ie;
} // if [icon]
} // while not atEnd()
line = in.readLine();
line = line.simplified();
if (line.startsWith("[icon]", Qt::CaseInsensitive) ) {
IconElement ie;
QString iconame;
do {
line = in.readLine();
if (line.startsWith("icon_name", Qt::CaseInsensitive) ) iconame = extractValue(line);
else if (line.startsWith("resource", Qt::CaseInsensitive) ) ie.resource_path = extractValue(line);
else if (line.startsWith("colorize", Qt::CaseInsensitive) ) ie.colorize = extractValue(line);
else if (line.startsWith("fdo_name", Qt::CaseInsensitive) ) ie.fdo_name = extractValue(line);
else if (line.startsWith("theme_names", Qt::CaseInsensitive) )
#if QT_VERSION >= 0x050e00
ie.theme_names = extractValue(line).split(',', Qt::SkipEmptyParts) ;
#else
ie.theme_names = extractValue(line).split(',', QString::SkipEmptyParts) ;
#endif
} while ( ! line.isEmpty() );
icon_map[iconame] = ie;
} // if [icon]
} // while not atEnd()
f1.close();

return;
Expand Down Expand Up @@ -267,11 +273,11 @@ QString IconManager::getFallback(const QString& name)
QFile f0(qrc);
if (!f0.open(QIODevice::ReadOnly | QIODevice::Text)) {
#if QT_VERSION >= 0x050400
qCritical("Error opening resource file: %s", qUtf8Printable(qrc) );
qCritical("Error opening resource file: %s", qUtf8Printable(qrc) );
#else
qCritical("Error opening resource file: %s", qPrintable(qrc) );
qCritical("Error opening resource file: %s", qPrintable(qrc) );
#endif
return rtnstr;
return rtnstr;
}

// Look for icon in the resource file and extract the resource value
Expand Down
1 change: 1 addition & 0 deletions apps/cmstapp/code/notify/notify.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ DEALINGS IN THE SOFTWARE.
# include <QPixmap>
# include <QTemporaryFile>
# include <QFile>
# include <QtGlobal>

# include "./notify.h"

Expand Down
2 changes: 1 addition & 1 deletion apps/resource.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ DEALINGS IN THE SOFTWARE.
///////////////////////////////// Program Values ///////////////////////
//
// Program Info (may be visible, but don't mark for tranalation)
#define VERSION "2020.08.02-1"
#define VERSION "2020.08.02-2"

#define RELEASE_DATE "9 May 2020"
#define COPYRIGHT_DATE "2013-2020"
Expand Down
1 change: 1 addition & 0 deletions cmst.pro
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ TRANSLATIONS += ./translations/cmst_es_ES.ts
TRANSLATIONS += ./translations/cmst_es_CO.ts
TRANSLATIONS += ./translations/cmst_fr_FR.ts
TRANSLATIONS += ./translations/cmst_tr_TR.ts
TRANSLATIONS += ./translations/cmst_nl_NL.ts

# non-application files which need to be installed
#
Expand Down
1 change: 1 addition & 0 deletions text/changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<ul>
<li>Added translation to Turkish by Yaşar Çiv.</li>
<li>Work around for KDE no longer displaying rich text in system tray icon popups (issue #216).</li>
<li>Fixed compiler warnings on QT depreciated functions.</li>
</ul>
<b> 2020.05.09</b>
<ul>
Expand Down

0 comments on commit 890da75

Please sign in to comment.