@@ -1103,7 +1103,8 @@ void DBManager::moveNode(int nodeId, const NodeData &target)
1103
1103
QSqlQuery query (m_db);
1104
1104
auto node = getNode (nodeId);
1105
1105
1106
- QString newAbsolutePath = target.absolutePath () + PATH_SEPARATOR + QString::number (nodeId);
1106
+ QString newAbsolutePath =
1107
+ QStringLiteral (" %1%2%3" ).arg (target.absolutePath (), PATH_SEPARATOR).arg (nodeId);
1107
1108
if (target.id () == SpecialNodeID::TrashFolder) {
1108
1109
qint64 deletionTime = QDateTime::currentMSecsSinceEpoch ();
1109
1110
query.prepare (QStringLiteral (
@@ -2415,13 +2416,15 @@ void DBManager::exportNotes(const QString &baseExportPath, const QString &extens
2415
2416
{
2416
2417
// Ensure the export directory exists
2417
2418
QString rootFolderName = QStringLiteral (" Notes" );
2418
- QString exportPathNew = baseExportPath + QDir::separator () + rootFolderName;
2419
+ QString exportPathNew =
2420
+ QStringLiteral (" %1%2%3" ).arg (baseExportPath, QDir::separator (), rootFolderName);
2419
2421
QDir directory;
2420
2422
2421
2423
int counter = 1 ;
2422
2424
while (directory.exists (exportPathNew)) {
2423
- exportPathNew = baseExportPath + QDir::separator () + rootFolderName + " "
2424
- + QString::number (counter++);
2425
+ exportPathNew = QStringLiteral (" %1%2%3 %4" )
2426
+ .arg (baseExportPath, QDir::separator (), rootFolderName)
2427
+ .arg (counter++);
2425
2428
}
2426
2429
qDebug () << " Exporting notes to:" << exportPathNew;
2427
2430
directory.mkpath (exportPathNew);
@@ -2449,8 +2452,9 @@ void DBManager::exportNotes(const QString &baseExportPath, const QString &extens
2449
2452
2450
2453
counter = 1 ;
2451
2454
while (directory.exists (path)) {
2452
- path = exportPathNew + QDir::separator () + relativePath + " "
2453
- + QString::number (counter++);
2455
+ path = QStringLiteral (" %1%2%3 %4" )
2456
+ .arg (exportPathNew, QDir::separator (), relativePath)
2457
+ .arg (counter++);
2454
2458
}
2455
2459
2456
2460
QDir ().mkpath (path);
@@ -2488,16 +2492,19 @@ void DBManager::exportNotes(const QString &baseExportPath, const QString &extens
2488
2492
safeTitle = doc.toPlainText ();
2489
2493
safeTitle.replace (QRegularExpression (R"( [\/\\:*?"<>|])" ),
2490
2494
" _" ); // Make the title filesystem-safe
2491
- QString filePath = notePath + QDir::separator () + safeTitle + extension;
2495
+ QString filePath =
2496
+ QStringLiteral (" %1%2%3%4" ).arg (notePath, QDir::separator (), safeTitle, extension);
2492
2497
2493
2498
if (safeTitle.isEmpty ()) {
2494
2499
safeTitle = QStringLiteral (" Untitled Note" );
2495
2500
}
2496
2501
2497
2502
counter = 1 ;
2498
2503
while (directory.exists (filePath)) {
2499
- filePath = notePath + QDir::separator () + safeTitle + " " + QString::number (counter++)
2500
- + extension;
2504
+ filePath = QStringLiteral (" %1%2%3 %4%5" )
2505
+ .arg (notePath, QDir::separator (), safeTitle)
2506
+ .arg (counter++)
2507
+ .arg (extension);
2501
2508
}
2502
2509
2503
2510
// qDebug() << "Exporting note:" << filePath;
0 commit comments