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