D17887: Fix detection of .kexi file types after recent change of mime database on Linux for SQLite type (2018-06-17)

Pino Toscano noreply at phabricator.kde.org
Tue Jan 1 21:52:30 GMT 2019


pino added a comment.


  I don't understand what is tested in `KDbTestUtils::testDriver()` now, related to the mimetypes. The old logic looked better (and simpler too) to me, I'd just leave that.
  The only simple addition IMHO is that `manager.driverIdsForMimeType(mimeName)` returns a valid driver for each of the mimetypes specified in the plugin metadata.
  
  Also, the commit message needs to be updated to just say that mimetypes are always resolved in the driver manager, so even if a mimetype claimed by a driver becomes an alias the plugin is still loaded.

INLINE COMMENTS

> CMakeLists.txt:6
>  
> -project(KDb VERSION 3.1.0) # Update this
> +project(KDb VERSION 3.2.0) # Update this
>  

unrelated

> KDbTestUtils.cpp:98-112
> +
> +static char *toString(const QStringList &list)
> +{
> +    return toString(qPrintable(QStringLiteral("QStringList(%1)").arg(list.join(", "))));
> +}
> +
> +KDBTESTUTILS_EXPORT bool qCompare(const QStringList &val1, const QStringList &val2,

already done by QTestLib

> KDbTestUtils.cpp:234
> +                                  "application/x-vnd.kde.kexi", "application/vnd.sqlite3" };
> +    const QStringList possiblyInvalidMimeTypes { "application/vnd.sqlite3" };
> +    testDriver("org.kde.kdb.sqlite", true /* file-based */, mimeTypes, possiblyInvalidMimeTypes);

I don't understand why this is "possibly invalid"; this is the new name of the sqlite3 mimetype, so this is pretty much valid

> KDbTestUtils.h:76-79
> +
> +KDBTESTUTILS_EXPORT bool qCompare(const QStringList &val1, const QStringList &val2,
> +                                  const char *actual, const char *expected, const char *file,
> +                                  int line);

QTestLib already supports comparing QStringList

> kdb_mysqldriver.json:93
>          ],
> -        "Version": "3.1",
> +        "Version": "3.2",
>          "Website": "https://kexi-project.org"

unrelated

> kdb_postgresqldriver.json:93
>          ],
> -        "Version": "3.1",
> +        "Version": "3.2",
>          "Website": "https://kexi-project.org"

unrelated

> kdb_sqlitedriver.json:96
>          ],
> -        "Version": "3.1",
> +        "Version": "3.2",
>          "Website": "https://kexi-project.org"

unrelated

> kdb_sybasedriver.json:93
>          ],
> -        "Version": "3.1",
> +        "Version": "3.2",
>          "Website": "https://kexi-project.org"

unrelated

> kdb_xbasedriver.json:93
>          ],
> -        "Version": "3.1",
> +        "Version": "3.2",
>          "Website": "https://kexi-project.org"

unrelated

> KDbUtils.cpp:2
>  /* This file is part of the KDE project
> -   Copyright (C) 2003-2016 Jarosław Staniek <staniek at kde.org>
> +   Copyright (C) 2003-2018 Jarosław Staniek <staniek at kde.org>
>  

unrelated

> KDbUtils.cpp:207-209
> +    if (_string.startsWith(QLatin1Char('.'))) {
> +        _string.prepend(QLatin1Char('_'));
> +    }

unrelated

> KDbUtils.h:2
>  /* This file is part of the KDE project
> -   Copyright (C) 2003-2016 Jarosław Staniek <staniek at kde.org>
> +   Copyright (C) 2003-2018 Jarosław Staniek <staniek at kde.org>
>  

unrelated

> KDbUtils.h:77-87
> +/**
> + * Returns a valid filename converted from given string
> + *
> + * Following steps are performed:
> + * - replace \\, /, :, *, ?, ", <, >, |, \n \\t characters with a space,
> + * - simplify whitespace by removing redundant space characters using QString::simplified().
> + * - prepend '_' character if the first character is '.', so the file will not be considered hidden

unrelated

REPOSITORY
  R15 KDb

REVISION DETAIL
  https://phabricator.kde.org/D17887

To: staniek, piggz, pino
Cc: pino, Kexi-Devel-list, barman, wicik, staniek
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kexi-devel/attachments/20190101/8ec71014/attachment-0001.html>


More information about the Kexi-devel mailing list