mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-04-26 14:23:09 +00:00
parent
3a6a2f78da
commit
70ec403a55
1 changed files with 7 additions and 1 deletions
|
|
@ -6,12 +6,15 @@
|
|||
|
||||
#include "recordutil.h"
|
||||
|
||||
#include <QDir>
|
||||
#include <QFile>
|
||||
#include <QStandardPaths>
|
||||
|
||||
#include <KFileUtils>
|
||||
#include <KNotification>
|
||||
|
||||
using namespace Qt::StringLiterals;
|
||||
|
||||
RecordUtil::RecordUtil(QObject *parent)
|
||||
: QObject{parent}
|
||||
{
|
||||
|
|
@ -19,7 +22,10 @@ RecordUtil::RecordUtil(QObject *parent)
|
|||
|
||||
QString RecordUtil::videoLocation(const QString &name)
|
||||
{
|
||||
QString path = QStandardPaths::writableLocation(QStandardPaths::MoviesLocation);
|
||||
const QString path = QStandardPaths::writableLocation(QStandardPaths::MoviesLocation);
|
||||
if (!QDir(path).mkpath(u"."_s)) {
|
||||
qWarning() << "Unable to create directory" << path;
|
||||
}
|
||||
QString newPath(path + '/' + name);
|
||||
if (QFile::exists(newPath)) {
|
||||
newPath = path + '/' + KFileUtils::suggestName(QUrl::fromLocalFile(newPath), name);
|
||||
|
|
|
|||
Loading…
Reference in a new issue