Fix crash when trying to open the folder creation dialog
authorFelix Weilbach <felix.weilbach@nextcloud.com>
Thu, 11 Mar 2021 11:14:17 +0000 (12:14 +0100)
committerFelix Weilbach <felix.weilbach@nextcloud.com>
Wed, 17 Mar 2021 07:43:32 +0000 (08:43 +0100)
The bug does seem to just appear in special compiler
constellations. We're unsure why this fix works. To better see if this
fix works or if crashes still occur, we added some logging.

Signed-off-by: Felix Weilbach <felix.weilbach@nextcloud.com>
src/gui/foldercreationdialog.cpp

index c9d8c7b08d1422b30e68ef1e07ef35c4c9eed0c8..6b2944a1faaa7b1e9fcb0eac5525325d1365afa4 100644 (file)
 
 #include <QDir>
 #include <QMessageBox>
+#include <QLoggingCategory>
 
 namespace OCC {
 
+Q_LOGGING_CATEGORY(lcFolderCreationDialog, "nextcloud.gui.foldercreationdialog", QtInfoMsg)
+
 FolderCreationDialog::FolderCreationDialog(const QString &destination, QWidget *parent)
     : QDialog(parent)
     , ui(new Ui::FolderCreationDialog)
@@ -37,7 +40,7 @@ FolderCreationDialog::FolderCreationDialog(const QString &destination, QWidget *
 
     const QString suggestedFolderNamePrefix = QObject::tr("New folder");
 
-    const auto newFolderFullPath = _destination + "/" + suggestedFolderNamePrefix;
+    const QString newFolderFullPath = _destination + QLatin1Char('/') + suggestedFolderNamePrefix;
     if (!QDir(newFolderFullPath).exists()) {
         ui->newFolderNameEdit->setText(suggestedFolderNamePrefix);
     } else {