Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package libqt6xdg for openSUSE:Factory 
checked in at 2025-11-06 18:14:05
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/libqt6xdg (Old)
 and      /work/SRC/openSUSE:Factory/.libqt6xdg.new.1980 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "libqt6xdg"

Thu Nov  6 18:14:05 2025 rev:7 rq:1315864 version:4.3.0

Changes:
--------
--- /work/SRC/openSUSE:Factory/libqt6xdg/libqt6xdg.changes      2025-10-14 
18:10:53.273314470 +0200
+++ /work/SRC/openSUSE:Factory/.libqt6xdg.new.1980/libqt6xdg.changes    
2025-11-06 18:16:30.367792107 +0100
@@ -1,0 +2,7 @@
+Wed Nov  5 16:12:47 UTC 2025 - Shawn Dunn <[email protected]>
+
+- Update to 4.3.0:
+  * Bumped the version and dependencies
+  * Drop libqt6xdg-qt610.patch
+
+-------------------------------------------------------------------

Old:
----
  libqt6xdg-qt610.patch
  libqtxdg-4.2.0.tar.xz
  libqtxdg-4.2.0.tar.xz.asc

New:
----
  libqtxdg-4.3.0.tar.xz
  libqtxdg-4.3.0.tar.xz.asc

----------(Old B)----------
  Old:  * Bumped the version and dependencies
  * Drop libqt6xdg-qt610.patch
----------(Old E)----------

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ libqt6xdg.spec ++++++
--- /var/tmp/diff_new_pack.vy6bMm/_old  2025-11-06 18:16:30.975817827 +0100
+++ /var/tmp/diff_new_pack.vy6bMm/_new  2025-11-06 18:16:30.979817997 +0100
@@ -17,10 +17,10 @@
 
 
 %define _name libqtxdg
-%define _sover 4.2.0
+%define _sover 4.3.0
 %define sover 4
 Name:           libqt6xdg
-Version:        4.2.0
+Version:        4.3.0
 Release:        0
 Summary:        Qt implementation of freedesktop.org xdg specs
 License:        LGPL-2.1-only AND SUSE-LGPL-2.1-with-digia-exception-1.1
@@ -28,9 +28,7 @@
 Source0:        %{url}/releases/download/%{version}/%{_name}-%{version}.tar.xz
 Source1:        
%{url}/releases/download/%{version}/%{_name}-%{version}.tar.xz.asc
 Source2:        %{name}.keyring
-# PATCH-FIX-UPSTREAM
-Patch0:         libqt6xdg-qt610.patch
-BuildRequires:  cmake >= 3.18.0
+BuildRequires:  cmake >= 3.5.0
 BuildRequires:  fdupes
 BuildRequires:  gcc-c++
 BuildRequires:  pkgconfig


++++++ libqtxdg-4.2.0.tar.xz -> libqtxdg-4.3.0.tar.xz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libqtxdg-4.2.0/CHANGELOG new/libqtxdg-4.3.0/CHANGELOG
--- old/libqtxdg-4.2.0/CHANGELOG        2025-04-17 10:29:30.000000000 +0200
+++ new/libqtxdg-4.3.0/CHANGELOG        2025-11-05 12:07:41.000000000 +0100
@@ -1,3 +1,11 @@
+libqtxdg-4.3.0 / 2025-11-05
+============================
+ * Fixed building with Qt 6.10.
+ * Fixed xdgdirs' `createdir` behavior.
+ * Miscellaneous code improvements.
+ * Xdg dirs better postfix
+ * Fixed XdgDirs documentation typo.
+
 libqtxdg-4.2.0 / 2025-04-17
 ============================
  * Adapted to changes in private headers of Qt 6.9.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libqtxdg-4.2.0/CMakeLists.txt 
new/libqtxdg-4.3.0/CMakeLists.txt
--- old/libqtxdg-4.2.0/CMakeLists.txt   2025-04-17 10:29:30.000000000 +0200
+++ new/libqtxdg-4.3.0/CMakeLists.txt   2025-11-05 12:07:41.000000000 +0100
@@ -14,11 +14,11 @@
 set(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH}" 
"${CMAKE_CURRENT_SOURCE_DIR}/cmake")
 
 set(QTXDG_MAJOR_VERSION 4)
-set(QTXDG_MINOR_VERSION 2)
+set(QTXDG_MINOR_VERSION 3)
 set(QTXDG_PATCH_VERSION 0)
 set(QTXDG_VERSION_STRING 
${QTXDG_MAJOR_VERSION}.${QTXDG_MINOR_VERSION}.${QTXDG_PATCH_VERSION})
 
-set(LXQTBT_MINIMUM_VERSION "2.2.0")
+set(LXQTBT_MINIMUM_VERSION "2.3.0")
 set(QT_MINIMUM_VERSION "6.6.0")
 set(GLIB_MINIMUM_VERSION "2.41.0") # Mime Apps new implementation
 
@@ -27,6 +27,10 @@
 find_package(GLIB ${GLIB_MINIMUM_VERSION} REQUIRED COMPONENTS gobject gio 
gio-unix)
 find_package(XTerm)
 
+if (Qt6Gui_VERSION VERSION_GREATER_EQUAL "6.10.0")
+    find_package(Qt6GuiPrivate ${QT_MINIMUM_VERSION} REQUIRED)
+endif()
+
 include(GNUInstallDirs)             # Standard directories for installation
 include(CMakePackageConfigHelpers)
 include(GenerateExportHeader)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libqtxdg-4.2.0/src/qtxdg/CMakeLists.txt 
new/libqtxdg-4.3.0/src/qtxdg/CMakeLists.txt
--- old/libqtxdg-4.2.0/src/qtxdg/CMakeLists.txt 2025-04-17 10:29:30.000000000 
+0200
+++ new/libqtxdg-4.3.0/src/qtxdg/CMakeLists.txt 2025-11-05 12:07:41.000000000 
+0100
@@ -78,6 +78,8 @@
 )
 
 target_link_libraries(${QTXDGX_LIBRARY_NAME}
+    PRIVATE
+        Qt6::GuiPrivate
     PUBLIC
         ${QTX_LIBRARIES}
         ${QTXDGX_ICONLOADER_LIBRARY_NAME}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libqtxdg-4.2.0/src/qtxdg/xdgdesktopfile.cpp 
new/libqtxdg-4.3.0/src/qtxdg/xdgdesktopfile.cpp
--- old/libqtxdg-4.2.0/src/qtxdg/xdgdesktopfile.cpp     2025-04-17 
10:29:30.000000000 +0200
+++ new/libqtxdg-4.3.0/src/qtxdg/xdgdesktopfile.cpp     2025-11-05 
12:07:41.000000000 +0100
@@ -97,7 +97,7 @@
 QStringList expandEnvVariables(const QStringList &strs);
 QString findDesktopFile(const QString& dirName, const QString& desktopName);
 QString findDesktopFile(const QString& desktopName);
-static QStringList parseCombinedArgString(const QString &program, const 
QList<int> &literals);
+static QStringList parseCombinedArgString(const QStringView program, const 
QList<int> &literals);
 bool read(const QString &prefix);
 void replaceVar(QString &str, const QString &varName, const QString &after);
 QString &unEscape(QString& str, bool exec);
@@ -1058,7 +1058,7 @@
 }
 
 
-static QStringList parseCombinedArgString(const QString &program, const 
QList<int> &literals)
+static QStringList parseCombinedArgString(const QStringView program, const 
QList<int> &literals)
 {
     QStringList args;
     QString tmp;
@@ -1077,7 +1077,7 @@
             // Add the literal to the arguments and jump to its end.
             int length = literals.at(n + 1) - literals.at(n) - 1;
             if (length > 0) {
-                tmp += program.mid(literals.at(n) + 1, length);
+                tmp += program.sliced(literals.at(n) + 1, length);
                 isLiteral = true;
             }
             i = literals.at(n + 1);
@@ -1129,6 +1129,7 @@
 
 QString expandEnvVariables(const QString &str)
 {
+    static QRegularExpression tildeHomeRegex{QString::fromLatin1("~(?=$|/)")};
     QString scheme = QUrl(str).scheme();
 
     if (scheme == QLatin1String("http")   || scheme == QLatin1String("https") 
|| scheme == QLatin1String("shttp") ||
@@ -1147,7 +1148,7 @@
     const QString homeDir = QFile::decodeName(qgetenv("HOME"));
 
     QString res = str;
-    res.replace(QRegularExpression(QString::fromLatin1("~(?=$|/)")), homeDir);
+    res.replace(tildeHomeRegex, homeDir);
 
     replaceVar(res, QLatin1String("HOME"), homeDir);
     replaceVar(res, QLatin1String("USER"), 
QString::fromLocal8Bit(qgetenv("USER")));
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libqtxdg-4.2.0/src/qtxdg/xdgdirs.cpp 
new/libqtxdg-4.3.0/src/qtxdg/xdgdirs.cpp
--- old/libqtxdg-4.2.0/src/qtxdg/xdgdirs.cpp    2025-04-17 10:29:30.000000000 
+0200
+++ new/libqtxdg-4.3.0/src/qtxdg/xdgdirs.cpp    2025-11-05 12:07:41.000000000 
+0100
@@ -33,6 +33,7 @@
 #include <QDebug>
 #include <QStandardPaths>
 
+using namespace Qt::Literals::StringLiterals;
 
 static const QString userDirectoryString[8] =
 {
@@ -52,6 +53,7 @@
 QString createDirectory(const QString &dir);
 
 void cleanAndAddPostfix(QStringList &dirs, const QString& postfix);
+QString handlePostfix(const QString &postfix);
 QString userDirFallback(XdgDirs::UserDirectory dir);
 
 /************************************************
@@ -82,6 +84,7 @@
         if (!d.mkpath(QLatin1String(".")))
         {
             qWarning() << QString::fromLatin1("Can't create %1 
directory.").arg(d.absolutePath());
+            return QString();
         }
     }
     QString r = d.absolutePath();
@@ -92,15 +95,27 @@
 
 void cleanAndAddPostfix(QStringList &dirs, const QString& postfix)
 {
+    const QString universalPostfix = handlePostfix(postfix);
     const int N = dirs.count();
     for(int i = 0; i < N; ++i)
     {
         fixBashShortcuts(dirs[i]);
         removeEndingSlash(dirs[i]);
-        dirs[i].append(postfix);
+        dirs[i].append(universalPostfix);
     }
 }
 
+QString handlePostfix(const QString &postfix)
+{
+    if (postfix.isEmpty())
+        return QString();
+
+    if (postfix.startsWith(u'/'))
+        return postfix;
+
+    return u'/' + postfix;
+}
+
 
 QString userDirFallback(XdgDirs::UserDirectory dir)
 {
@@ -229,7 +244,8 @@
     if (createDir) {
         QString path = QString(value).replace(QLatin1String("$HOME"), 
QLatin1String("~"));
         fixBashShortcuts(path);
-        QDir().mkpath(path);
+
+        return createDirectory(path).isEmpty() ? false : true;
     }
 
     return true;
@@ -321,7 +337,12 @@
 
 QString XdgDirs::autostartHome(bool createDir)
 {
-    QString s = QString::fromLatin1("%1/autostart").arg(configHome(createDir));
+    const QString confHome = configHome(createDir);
+
+    if (confHome.isEmpty())
+        return QString();
+
+    QString s = confHome + "/autostart"_L1;
     fixBashShortcuts(s);
 
     if (createDir)
@@ -339,7 +360,8 @@
     QStringList dirs;
     const QStringList s = configDirs();
     for (const QString &dir : s)
-        dirs << QString::fromLatin1("%1/autostart").arg(dir) + postfix;
+        dirs << QString::fromLatin1("%1/autostart").arg(dir);
 
+    cleanAndAddPostfix(dirs, postfix);
     return dirs;
 }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libqtxdg-4.2.0/src/qtxdg/xdgdirs.h 
new/libqtxdg-4.3.0/src/qtxdg/xdgdirs.h
--- old/libqtxdg-4.2.0/src/qtxdg/xdgdirs.h      2025-04-17 10:29:30.000000000 
+0200
+++ new/libqtxdg-4.3.0/src/qtxdg/xdgdirs.h      2025-11-05 12:07:41.000000000 
+0100
@@ -32,11 +32,11 @@
 #include <QString>
 #include <QStringList>
 
-/*! @brief The XdgMenu class implements the "XDG Base Directory Specification" 
from freedesktop.org.
+/*! @brief The XdgDirs class implements the "XDG Base Directory Specification" 
from freedesktop.org.
  * This specification defines where these files should be looked for by 
defining one or more base
  * directories relative to which files should be located.
  *
- * All postfix parameters should start with an '/' slash.
+ * postfix parameters can start with or without an '/u' slash. Both cases are 
handled.
  *
  * @sa http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html
  */
@@ -72,7 +72,8 @@
 
     /*! @brief Returns true if writing into configuration file 
$XDG_CONFIG_HOME/user-dirs.dirs
      * the path in value for the directory in dir is succesfull. Returns false 
otherwise. If
-     * createDir is true, dir will be created if it doesn't exist.
+     * createDir is true, dir will be created if it doesn't exist. Returns 
true if dir creation
+     * is succesfull, false otherwise.
      */
     static bool setUserDir(UserDirectory dir, const QString &value, bool 
createDir);
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libqtxdg-4.2.0/src/qtxdg/xdgmenulayoutprocessor.cpp 
new/libqtxdg-4.3.0/src/qtxdg/xdgmenulayoutprocessor.cpp
--- old/libqtxdg-4.2.0/src/qtxdg/xdgmenulayoutprocessor.cpp     2025-04-17 
10:29:30.000000000 +0200
+++ new/libqtxdg-4.3.0/src/qtxdg/xdgmenulayoutprocessor.cpp     2025-11-05 
12:07:41.000000000 +0100
@@ -28,7 +28,8 @@
 #include "xdgmenulayoutprocessor.h"
 #include "xmlhelper.h"
 #include <QDebug>
-#include <QMap>
+#include <QCollator>
+#include <QList>
 
 
 // Helper functions prototypes
@@ -386,7 +387,7 @@
 void XdgMenuLayoutProcessor::processMergeTag(const QDomElement &element)
 {
     QString type = element.attribute(QLatin1String("type"));
-    QMap<QString, QDomElement> map;
+    QList<QDomElement> elements;
     MutableDomElementIterator it(mElement);
 
     while (it.hasNext())
@@ -396,13 +397,20 @@
             ((type == QLatin1String("menus") || type == QLatin1String("all")) 
&& e.tagName() == QLatin1String("Menu" )) ||
             ((type == QLatin1String("files") || type == QLatin1String("all")) 
&& e.tagName() == QLatin1String("AppLink"))
            )
-            map.insert(e.attribute(QLatin1String("title")), e);
+            elements.append(e);
     }
 
-    QMapIterator<QString, QDomElement> mi(map);
-    while (mi.hasNext()) {
-        mi.next();
-        mResult.insertBefore(mi.value(), element);
+    QCollator collator;
+    collator.setCaseSensitivity(Qt::CaseInsensitive);
+
+    std::sort(elements.begin(), elements.end(),
+              [&](const QDomElement &a, const QDomElement &b) {
+                  return collator.compare(a.attribute(QLatin1String("title")),
+                                          b.attribute(QLatin1String("title"))) 
< 0;
+              });
+
+    for (const QDomElement &e : elements) {
+        mResult.insertBefore(e, element);
     }
 
     mResult.removeChild(element);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libqtxdg-4.2.0/src/xdgiconloader/CMakeLists.txt 
new/libqtxdg-4.3.0/src/xdgiconloader/CMakeLists.txt
--- old/libqtxdg-4.2.0/src/xdgiconloader/CMakeLists.txt 2025-04-17 
10:29:30.000000000 +0200
+++ new/libqtxdg-4.3.0/src/xdgiconloader/CMakeLists.txt 2025-11-05 
12:07:41.000000000 +0100
@@ -50,6 +50,8 @@
 )
 
 target_link_libraries(${QTXDGX_ICONLOADER_LIBRARY_NAME}
+    PRIVATE
+        Qt6::GuiPrivate
     PUBLIC
         Qt6::Gui
         Qt6::Svg
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/libqtxdg-4.2.0/src/xdgiconloader/plugin/CMakeLists.txt 
new/libqtxdg-4.3.0/src/xdgiconloader/plugin/CMakeLists.txt
--- old/libqtxdg-4.2.0/src/xdgiconloader/plugin/CMakeLists.txt  2025-04-17 
10:29:30.000000000 +0200
+++ new/libqtxdg-4.3.0/src/xdgiconloader/plugin/CMakeLists.txt  2025-11-05 
12:07:41.000000000 +0100
@@ -11,6 +11,8 @@
         "QT_NO_KEYWORDS"
 )
 target_link_libraries(${QTXDGX_ICONENGINEPLUGIN_LIBRARY_NAME}
+    PRIVATE
+        Qt6::GuiPrivate
     PUBLIC
         Qt6::Gui
         "${QTXDGX_ICONLOADER_LIBRARY_NAME}"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libqtxdg-4.2.0/test/qtxdg_test.cpp 
new/libqtxdg-4.3.0/test/qtxdg_test.cpp
--- old/libqtxdg-4.2.0/test/qtxdg_test.cpp      2025-04-17 10:29:30.000000000 
+0200
+++ new/libqtxdg-4.3.0/test/qtxdg_test.cpp      2025-11-05 12:07:41.000000000 
+0100
@@ -35,7 +35,7 @@
 #include "xdgdirs.h"
 #include "xdgmimeapps.h"
 
-#include <QtTest>
+#include <QTest>
 
 #include <QDir>
 #include <QFileInfo>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libqtxdg-4.2.0/test/tst_xdgdesktopfile.cpp 
new/libqtxdg-4.3.0/test/tst_xdgdesktopfile.cpp
--- old/libqtxdg-4.2.0/test/tst_xdgdesktopfile.cpp      2025-04-17 
10:29:30.000000000 +0200
+++ new/libqtxdg-4.3.0/test/tst_xdgdesktopfile.cpp      2025-11-05 
12:07:41.000000000 +0100
@@ -20,7 +20,9 @@
 
 #include "tst_xdgdesktopfile.h"
 #include "XdgDesktopFile"
-#include <QtTest>
+
+#include <QTemporaryFile>
+#include <QTest>
 
 
 class Language
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libqtxdg-4.2.0/test/tst_xdgdirs.cpp 
new/libqtxdg-4.3.0/test/tst_xdgdirs.cpp
--- old/libqtxdg-4.2.0/test/tst_xdgdirs.cpp     2025-04-17 10:29:30.000000000 
+0200
+++ new/libqtxdg-4.3.0/test/tst_xdgdirs.cpp     2025-11-05 12:07:41.000000000 
+0100
@@ -29,9 +29,28 @@
 
 #include "xdgdirs.h"
 
-#include <QtTest>
+#include <QDir>
+#include <QFileInfo>
+#include <QRandomGenerator>
+#include <QTest>
 #include <QTemporaryDir>
 
+using namespace Qt::Literals::StringLiterals;
+
+QString randomString(int length)
+{
+    static const QString 
characterPool("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"_L1);
+    if (length < 0)
+        return QString();
+
+    QString randomString;
+    for (int i = 0; i < length; ++i) {
+        const int index = QRandomGenerator::global()->generate() % 
characterPool.size();
+        randomString.append(characterPool.at(index));
+    }
+    return randomString;
+}
+
 class tst_xdgdirs : public QObject
 {
     Q_OBJECT
@@ -47,10 +66,15 @@
     void testCacheHome();
     void testAutostartHome();
     void testAutostartDirs();
+    void testNonWritableLocations();
 
 private:
     void setDefaultLocations();
     void setCustomLocations();
+    void setNonWritableLocations();
+
+    QString noSlashPostfix;
+    QString postfix;
 
     QString m_configHome;
     QTemporaryDir m_configHomeTemp;
@@ -62,18 +86,28 @@
     QTemporaryDir m_dataDirsTemp;
     QString m_cacheHome;
     QTemporaryDir m_cacheHomeTemp;
+
+    QDir m_nonWritableRoot;
+    QString m_configHomeNonWritable;
 };
 
 void tst_xdgdirs::initTestCase()
 {
     QCoreApplication::instance()->setOrganizationName(QStringLiteral("QtXdg"));
     
QCoreApplication::instance()->setApplicationName(QStringLiteral("tst_xdgdirs"));
+
+    noSlashPostfix = QCoreApplication::applicationName();
+    postfix = u'/' + QCoreApplication::applicationName();
 }
 
 void tst_xdgdirs::cleanupTestCase()
 {
     QCoreApplication::instance()->setOrganizationName(QString());
     QCoreApplication::instance()->setApplicationName(QString());
+
+    QFile f(m_nonWritableRoot.path());
+    QVERIFY(f.setPermissions(QFile::WriteUser | QFile::WriteOwner));
+    QVERIFY(m_nonWritableRoot.removeRecursively());
 }
 
 void tst_xdgdirs::setDefaultLocations()
@@ -100,12 +134,27 @@
 
 }
 
+void tst_xdgdirs::setNonWritableLocations()
+{
+    const QString randomDir = randomString(8);
+    m_nonWritableRoot = QDir::temp();
+
+    QVERIFY(m_nonWritableRoot.mkdir(randomDir, QFileDevice::ReadUser));
+    m_nonWritableRoot.cd(randomDir);
+    m_configHomeNonWritable = m_nonWritableRoot.path() + u'/' + 
"nonwritabledir"_L1;
+
+    qputenv("XDG_CONFIG_HOME", QFile::encodeName(m_configHomeNonWritable));
+    qputenv("XDG_DATA_HOME", QFile::encodeName(m_configHomeNonWritable));
+    qputenv("XDG_CACHE_HOME", QFile::encodeName(m_configHomeNonWritable));
+}
+
 void tst_xdgdirs::testDataHome()
 {
     setDefaultLocations();
     const QString expectedDataHome = QDir::homePath() + 
QString::fromLatin1("/.local/share");
     QCOMPARE(XdgDirs::dataHome(), expectedDataHome);
     QCOMPARE(XdgDirs::dataHome(false), expectedDataHome);
+    QCOMPARE(XdgDirs::dataHome(true), expectedDataHome);
 
     setCustomLocations();
     QCOMPARE(XdgDirs::dataHome(), m_dataHome);
@@ -126,8 +175,6 @@
 
 void tst_xdgdirs::testDataDirs()
 {
-    const QString postfix = QString::fromLatin1("/") + 
QCoreApplication::applicationName();
-
     setDefaultLocations();
     const QStringList dataDirs = XdgDirs::dataDirs();
     QCOMPARE(dataDirs.count(), 2);
@@ -139,6 +186,11 @@
     QCOMPARE(dataDirsWithPostfix.at(0), 
QString::fromLatin1("/usr/local/share") + postfix);
     QCOMPARE(dataDirsWithPostfix.at(1), QString::fromLatin1("/usr/share") + 
postfix);
 
+    const QStringList dataDirsWithNoSlashPostfix = 
XdgDirs::dataDirs(noSlashPostfix);
+    QCOMPARE(dataDirsWithNoSlashPostfix.count(), 2);
+    QCOMPARE(dataDirsWithNoSlashPostfix.at(0), "/usr/local/share"_L1 + u'/' + 
noSlashPostfix);
+    QCOMPARE(dataDirsWithNoSlashPostfix.at(1), "/usr/share"_L1 + u'/' + 
noSlashPostfix);
+
     setCustomLocations();
     const QStringList dataDirsCustom = XdgDirs::dataDirs();
     QCOMPARE(dataDirsCustom.count(), 1);
@@ -147,11 +199,14 @@
     const QStringList dataDirsCustomWithPostfix = XdgDirs::dataDirs(postfix);
     QCOMPARE(dataDirsCustomWithPostfix.count(), 1);
     QCOMPARE(dataDirsCustomWithPostfix.at(0), m_dataDirs + postfix);
+
+    const QStringList dataDirsCustomWithNoSlashPostfix;
+    QCOMPARE(dataDirsCustomWithPostfix.count(), 1);
+    QCOMPARE(dataDirsCustomWithPostfix.at(0), m_dataDirs + u'/' + 
noSlashPostfix);
 }
 
 void tst_xdgdirs::testConfigDirs()
 {
-    const QString postfix = QString::fromLatin1("/") + 
QCoreApplication::applicationName();
     setDefaultLocations();
 
     const QStringList configDirs = XdgDirs::configDirs();
@@ -201,8 +256,6 @@
 
 void tst_xdgdirs::testAutostartDirs()
 {
-    const QString postfix = QString::fromLatin1("/") + 
QCoreApplication::applicationName();
-
     setDefaultLocations();
     const QStringList autostartDirs = XdgDirs::autostartDirs();
     QCOMPARE(autostartDirs.count(), 1);
@@ -212,6 +265,9 @@
     QCOMPARE(autostartDirsWithPostfix.count(), 1);
     QCOMPARE(autostartDirsWithPostfix.at(0), 
QString::fromLatin1("/etc/xdg/autostart") + postfix);
 
+    const QStringList autostartDirsWithNoSlashPostfix = 
XdgDirs::autostartDirs(noSlashPostfix);
+    QCOMPARE(autostartDirsWithNoSlashPostfix.count(), 1);
+    QCOMPARE(autostartDirsWithNoSlashPostfix.at(0), "/etc/xdg/autostart"_L1 + 
u'/' + noSlashPostfix);
 
     setCustomLocations();
     const QStringList autostartDirsCustom = XdgDirs::autostartDirs();
@@ -221,6 +277,19 @@
     const QStringList autostartDirsCustomWithPostfix = 
XdgDirs::autostartDirs(postfix);
     QCOMPARE(autostartDirsCustomWithPostfix.count(), 1);
     QCOMPARE(autostartDirsCustomWithPostfix.at(0), m_configDirs + 
QString::fromLatin1("/autostart") + postfix);
+
+    const QStringList autostartDirsCustomWithNoSlashPostfix = 
XdgDirs::autostartDirs(noSlashPostfix);
+    QCOMPARE(autostartDirsCustomWithNoSlashPostfix.count(), 1);
+    QCOMPARE(autostartDirsCustomWithNoSlashPostfix.at(0), m_configDirs + 
"/autostart"_L1 + u'/' + noSlashPostfix);
+}
+
+void tst_xdgdirs::testNonWritableLocations()
+{
+    setNonWritableLocations();
+    QCOMPARE(XdgDirs::configHome(true), QString());
+    QCOMPARE(XdgDirs::dataHome(true), QString());
+    QCOMPARE(XdgDirs::cacheHome(true), QString());
+    QCOMPARE(XdgDirs::autostartHome(true), QString());
 }
 
 QTEST_APPLESS_MAIN(tst_xdgdirs)

Reply via email to