various UI reimplementations from 0.1.x
This commit is contained in:
@@ -20,6 +20,7 @@
|
||||
|
||||
#include "filefunctions.h"
|
||||
|
||||
#include <QCoreApplication>
|
||||
#include <QCryptographicHash>
|
||||
#include <QDateTime>
|
||||
#include <QDir>
|
||||
@@ -73,3 +74,22 @@ QString GetMediaCacheLocation()
|
||||
|
||||
return media_cache_dir.absolutePath();
|
||||
}
|
||||
|
||||
QString GetConfigurationLocation()
|
||||
{
|
||||
if (IsPortable()) {
|
||||
return GetApplicationPath();
|
||||
} else {
|
||||
return QStandardPaths::writableLocation(QStandardPaths::AppConfigLocation);
|
||||
}
|
||||
}
|
||||
|
||||
bool IsPortable()
|
||||
{
|
||||
return QFileInfo::exists(QDir(GetApplicationPath()).filePath("portable"));
|
||||
}
|
||||
|
||||
QString GetApplicationPath()
|
||||
{
|
||||
return QCoreApplication::applicationDirPath();
|
||||
}
|
||||
|
||||
@@ -23,6 +23,8 @@
|
||||
|
||||
#include <QString>
|
||||
|
||||
bool IsPortable();
|
||||
|
||||
QString GetUniqueFileIdentifier(const QString& filename);
|
||||
|
||||
QString GetMediaIndexLocation();
|
||||
@@ -31,4 +33,8 @@ QString GetMediaIndexFilename(const QString& filename);
|
||||
|
||||
QString GetMediaCacheLocation();
|
||||
|
||||
QString GetConfigurationLocation();
|
||||
|
||||
QString GetApplicationPath();
|
||||
|
||||
#endif // FILEFUNCTIONS_H
|
||||
|
||||
@@ -22,6 +22,8 @@
|
||||
|
||||
#include <QtMath>
|
||||
|
||||
#include "config/config.h"
|
||||
|
||||
QString padded(int arg, int padding) {
|
||||
return QString("%1").arg(arg, padding, 10, QChar('0'));
|
||||
}
|
||||
@@ -91,3 +93,8 @@ int64_t olive::time_to_timestamp(const rational &time, const rational &timebase)
|
||||
{
|
||||
return qRound64(time.toDouble() * timebase.flipped().toDouble());
|
||||
}
|
||||
|
||||
olive::TimecodeDisplay olive::CurrentTimecodeDisplay()
|
||||
{
|
||||
return static_cast<olive::TimecodeDisplay>(Config::Current()["TimecodeDisplay"].toInt());
|
||||
}
|
||||
|
||||
@@ -34,6 +34,8 @@ enum TimecodeDisplay {
|
||||
kMilliseconds
|
||||
};
|
||||
|
||||
TimecodeDisplay CurrentTimecodeDisplay();
|
||||
|
||||
/**
|
||||
* @brief Convert a timestamp (according to a rational timebase) to a user-friendly string representation
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user