-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathutilities.cpp
31 lines (27 loc) · 949 Bytes
/
utilities.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#include "utilities.h"
#include <QStandardPaths>
#include <QDir>
#include <QDebug>
#include <QDateTime>
QString utilities::getDataPath()
{
// get the standard locations
QString user_movie_path = QStandardPaths::standardLocations( QStandardPaths::MoviesLocation)[0];
// qDebug() <<QString("user movie path : " ) + user_movie_path;
// initialise a movie dir and make a new folder
QDir movie_dir(user_movie_path);
movie_dir.mkpath("software");
// return the path of newly created folder.
QString directory = movie_dir.absoluteFilePath("software");
// qDebug() <<"directory created : " + directory;
return directory;
}
QString utilities::newSavedVideoName()
{
QDateTime time = QDateTime::currentDateTime();
return time.toString("yyyy-MM-dd+HH:mm:ss");
}
QString utilities::getSavedVideoPath(QString name, QString postfix)
{
return QString("%1/%2.%3").arg(utilities::getDataPath(), name, postfix);
}