Browse Source

refactor(status): remove Status::getFromString and Status::getIconPixmap

getFromString is unused and incompatible with translated UI names, getIconPixmap is unused and completely generic.
reviewable/pr5636/r2
Anthony Bilinski 6 years ago
parent
commit
e1876a2691
No known key found for this signature in database
GPG Key ID: 2AA8E0DA1B31FB3C
  1. 25
      src/model/status.cpp
  2. 2
      src/model/status.h

25
src/model/status.cpp

@ -28,13 +28,6 @@ @@ -28,13 +28,6 @@
namespace Status
{
QPixmap getIconPixmap(QString path, uint32_t w, uint32_t h)
{
QPixmap pix(w, h);
pix.load(path);
return pix;
}
QString getTitle(Status status)
{
switch (status) {
@ -54,24 +47,6 @@ namespace Status @@ -54,24 +47,6 @@ namespace Status
return QStringLiteral("");
}
Status getFromString(QString status)
{
if (status == QStringLiteral("online"))
return Status::Online;
else if (status == QStringLiteral("away"))
return Status::Away;
else if (status == QStringLiteral("busy"))
return Status::Busy;
else if (status == QStringLiteral("offline"))
return Status::Offline;
else if (status == QStringLiteral("blocked"))
return Status::Blocked;
else {
assert(false);
return Status::Offline;
}
}
QString getIconPath(Status status, bool event)
{
const QString eventSuffix = event ? QStringLiteral("_notification") : QString();

2
src/model/status.h

@ -36,9 +36,7 @@ namespace Status @@ -36,9 +36,7 @@ namespace Status
};
QString getIconPath(Status status, bool event = false);
QPixmap getIconPixmap(QString path, uint32_t w, uint32_t h);
QString getTitle(Status status);
Status getFromString(QString status);
}
#endif // STATUS_H

Loading…
Cancel
Save