Changeset View
Changeset View
Standalone View
Standalone View
runners/bookmarks/browsers/findprofile.h
Show All 15 Lines | |||||
16 | * License along with this program; if not, write to the | 16 | * License along with this program; if not, write to the | ||
17 | * Free Software Foundation, Inc., | 17 | * Free Software Foundation, Inc., | ||
18 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | 18 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
19 | */ | 19 | */ | ||
20 | #ifndef FIND_PROFILE_H | 20 | #ifndef FIND_PROFILE_H | ||
21 | #define FIND_PROFILE_H | 21 | #define FIND_PROFILE_H | ||
22 | #include <QString> | 22 | #include <QString> | ||
23 | #include <QList> | 23 | #include <QList> | ||
24 | #include <QStandardPaths> | ||||
24 | 25 | | |||
25 | class Favicon; | 26 | class Favicon; | ||
26 | class Profile { | 27 | class Profile { | ||
27 | public: | 28 | public: | ||
28 | Profile(const QString &path, Favicon *favicon) : m_path(path), m_favicon(favicon) {} | 29 | Profile(const QString &path, const QString &name, Favicon *favicon) : m_path(path), m_name(name), m_favicon(favicon){ | ||
30 | // Remove "Bookmarks" from end of path | ||||
31 | m_faviconSource = path.chopped(9) + QStringLiteral("Favicons"); | ||||
32 | m_faviconCache = QStringLiteral("%1/KRunner-Chrome-Favicons-%2.sqlite") | ||||
33 | .arg(QStandardPaths::writableLocation(QStandardPaths::CacheLocation), name); | ||||
34 | } | ||||
29 | inline QString path() const { return m_path; } | 35 | inline QString path() const { return m_path; } | ||
36 | inline QString name() const { return m_name; } | ||||
30 | inline Favicon *favicon() const { return m_favicon; } | 37 | inline Favicon *favicon() const { return m_favicon; } | ||
38 | inline QString faviconSource() const { return m_faviconSource; } | ||||
39 | inline QString faviconCache() const { return m_faviconCache; } | ||||
31 | private: | 40 | private: | ||
32 | QString m_path; | 41 | QString m_path; | ||
42 | QString m_name; | ||||
33 | Favicon *m_favicon; | 43 | Favicon *m_favicon; | ||
44 | QString m_faviconSource; | ||||
45 | QString m_faviconCache; | ||||
34 | }; | 46 | }; | ||
35 | 47 | | |||
36 | class FindProfile { | 48 | class FindProfile { | ||
37 | public: | 49 | public: | ||
38 | virtual QList<Profile> find() = 0; | 50 | virtual QList<Profile> find() = 0; | ||
39 | virtual ~FindProfile() {} | 51 | virtual ~FindProfile() {} | ||
40 | }; | 52 | }; | ||
41 | 53 | | |||
42 | #endif | 54 | #endif |