mirror of
https://github.com/qTox/qTox.git
synced 2024-03-22 14:00:36 +08:00
refactor(status): remove Status::getFromString and Status::getIconPixmap
getFromString is unused and incompatible with translated UI names, getIconPixmap is unused and completely generic.
This commit is contained in:
parent
dd007877a9
commit
e1876a2691
|
@ -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
|
|||
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();
|
||||
|
|
|
@ -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…
Reference in New Issue
Block a user