mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-07 02:35:33 +08:00
Utility functions for notification sounds
This commit is contained in:
committed by
Mat Sutcliffe
parent
9450dfc3b0
commit
77a898c9ec
@@ -10,6 +10,7 @@
|
||||
#include "blackmisc/math/mathutils.h"
|
||||
#include "blackmisc/worker.h"
|
||||
#include "blackmisc/fileutils.h"
|
||||
#include "blackmisc/directoryutils.h"
|
||||
#include "blackconfig/buildconfig.h"
|
||||
|
||||
#include <QCoreApplication>
|
||||
@@ -574,4 +575,16 @@ namespace BlackMisc
|
||||
if (fileName.isEmpty()) { return false; }
|
||||
return fileName.contains("swift", Qt::CaseInsensitive) && fileName.contains("installer");
|
||||
}
|
||||
|
||||
QString CFileUtils::soundFilePathAndFileName(const QString &name)
|
||||
{
|
||||
if (name.isEmpty()) { return {}; }
|
||||
return CFileUtils::appendFilePaths(CDirectoryUtils::soundFilesDirectory(), name);
|
||||
}
|
||||
|
||||
QUrl CFileUtils::soundFileQUrl(const QString &name)
|
||||
{
|
||||
if (name.isEmpty()) { return {}; }
|
||||
return QUrl::fromLocalFile(CFileUtils::soundFilePathAndFileName(name));
|
||||
}
|
||||
} // ns
|
||||
|
||||
@@ -13,12 +13,13 @@
|
||||
|
||||
#include "blackmisc/blackmiscexport.h"
|
||||
|
||||
#include <QUrl>
|
||||
#include <QDir>
|
||||
#include <QFileInfo>
|
||||
#include <QFileInfoList>
|
||||
#include <QLockFile>
|
||||
#include <QString>
|
||||
#include <QStringList>
|
||||
#include <QString>
|
||||
#include <Qt>
|
||||
#include <functional>
|
||||
|
||||
@@ -197,6 +198,12 @@ namespace BlackMisc
|
||||
|
||||
//! swift installer
|
||||
static bool isSwiftInstaller(const QString &fileName);
|
||||
|
||||
//! Returns the full path and file name for a sound file
|
||||
static QString soundFilePathAndFileName(const QString &name);
|
||||
|
||||
//! QUrl of soundFilePathAndFileName
|
||||
static QUrl soundFileQUrl(const QString &name);
|
||||
};
|
||||
} // ns
|
||||
|
||||
|
||||
Reference in New Issue
Block a user