File indexing completed on 2024-05-19 05:06:55

0001 /*
0002     SPDX-FileCopyrightText: 2021 Dawid Wróbel <me@dawidwrobel.com>
0003     SPDX-FileCopyrightText: 2021 Thomas Baumgart <tbaumgart@kde.org>
0004 
0005     SPDX-License-Identifier: GPL-2.0-or-later
0006 */
0007 
0008 #ifndef KMMURL_H
0009 #define KMMURL_H
0010 
0011 #undef QUrl
0012 
0013 // ----------------------------------------------------------------------------
0014 // QT Includes
0015 
0016 #include <QString>
0017 #include <QUrl>
0018 
0019 
0020 class KMMUrl: public QUrl
0021 {
0022 public:
0023     KMMUrl();
0024     KMMUrl(const KMMUrl &copy);
0025     KMMUrl(const QUrl &copy);
0026 
0027     static KMMUrl fromUserInput(const QString &userInput);
0028     QString toLocalFile() const;
0029 
0030 private:
0031     static QString normalizeUrlString(const QString &url);
0032 
0033 };
0034 
0035 /**
0036  * Make it possible to hold @ref KMMUrl objects inside @ref QVariant objects.
0037  */
0038 Q_DECLARE_METATYPE(KMMUrl)
0039 
0040 #define QUrl KMMUrl
0041 #endif // KMMURL_H