[dolphin] Don't rely on QByteArray -> const char * implicit conversion
authorKevin Ottens <ervin@kde.org>
Wed, 27 Dec 2023 18:08:36 +0000 (19:08 +0100)
committerKevin Ottens <ervin@kde.org>
Wed, 6 Mar 2024 13:52:36 +0000 (14:52 +0100)
Signed-off-by: Kevin Ottens <ervin@kde.org>
shell_integration/dolphin/ownclouddolphinactionplugin.cpp
shell_integration/dolphin/ownclouddolphinoverlayplugin.cpp

index e7c2e7b84c2762c9f6b21330022b08bb770128e5..75677996e1de050a7e96ef2a0a2fc5293b66de2e 100644 (file)
@@ -77,12 +77,12 @@ public:
                     action->setDisabled(true);
                 auto call = args.value(1).toLatin1();
                 connect(action, &QAction::triggered, [helper, call, files] {
-                    helper->sendCommand(QByteArray(call + ":" + files + "\n"));
+                    helper->sendCommand(QByteArray(call + ":" + files + "\n").constData());
                 });
             }
         });
         QTimer::singleShot(100, &loop, &QEventLoop::quit); // add a timeout to be sure we don't freeze dolphin
-        helper->sendCommand(QByteArray("GET_MENU_ITEMS:" + files + "\n"));
+        helper->sendCommand(QByteArray("GET_MENU_ITEMS:" + files + "\n").constData());
         loop.exec(QEventLoop::ExcludeUserInputEvents);
         disconnect(con);
         if (menu->actions().isEmpty()) {
@@ -111,20 +111,20 @@ public:
 
         auto shareAction = menu->addAction(helper->shareActionTitle());
         connect(shareAction, &QAction::triggered, this, [localFile, helper] {
-            helper->sendCommand(QByteArray("SHARE:" + localFile.toUtf8() + "\n"));
+            helper->sendCommand(QByteArray("SHARE:" + localFile.toUtf8() + "\n").constData());
         });
 
         if (!helper->copyPrivateLinkTitle().isEmpty()) {
             auto copyPrivateLinkAction = menu->addAction(helper->copyPrivateLinkTitle());
             connect(copyPrivateLinkAction, &QAction::triggered, this, [localFile, helper] {
-                helper->sendCommand(QByteArray("COPY_PRIVATE_LINK:" + localFile.toUtf8() + "\n"));
+                helper->sendCommand(QByteArray("COPY_PRIVATE_LINK:" + localFile.toUtf8() + "\n").constData());
             });
         }
 
         if (!helper->emailPrivateLinkTitle().isEmpty()) {
             auto emailPrivateLinkAction = menu->addAction(helper->emailPrivateLinkTitle());
             connect(emailPrivateLinkAction, &QAction::triggered, this, [localFile, helper] {
-                helper->sendCommand(QByteArray("EMAIL_PRIVATE_LINK:" + localFile.toUtf8() + "\n"));
+                helper->sendCommand(QByteArray("EMAIL_PRIVATE_LINK:" + localFile.toUtf8() + "\n").constData());
             });
         }
         return { menuaction };
index 7c43b2349ba7dd083bedeb297dd722f19a39a7bd..ed28448a6e40c540d47894283a86e8fbf4f1393f 100644 (file)
@@ -50,7 +50,7 @@ public:
         QDir localPath(url.toLocalFile());
         const QByteArray localFile = localPath.canonicalPath().toUtf8();
 
-        helper->sendCommand(QByteArray("RETRIEVE_FILE_STATUS:" + localFile + "\n"));
+        helper->sendCommand(QByteArray("RETRIEVE_FILE_STATUS:" + localFile + "\n").constData());
 
         StatusMap::iterator it = m_status.find(localFile);
         if (it != m_status.constEnd()) {