summaryrefslogtreecommitdiff
path: root/src/urlbar/urlresolver.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/urlbar/urlresolver.h')
-rw-r--r--src/urlbar/urlresolver.h65
1 files changed, 8 insertions, 57 deletions
diff --git a/src/urlbar/urlresolver.h b/src/urlbar/urlresolver.h
index 83228140..c79ce184 100644
--- a/src/urlbar/urlresolver.h
+++ b/src/urlbar/urlresolver.h
@@ -33,14 +33,11 @@
// KDE Includes
#include <KUrl>
-#include <KCompletion>
+
// Qt Includes
#include <QString>
#include <QList>
-#include <QDateTime>
-
-class AwesomeUrlCompletion;
class UrlSearchItem
{
@@ -58,60 +55,36 @@ public:
int type;
QString url;
QString title;
- QDateTime visitDateTime;
- int visitCount;
QString description;
QString bookmarkPath;
UrlSearchItem(const UrlSearchItem &item) : type(item.type),
url(item.url),
title(item.title),
- visitDateTime(item.visitDateTime),
- visitCount(item.visitCount),
- description(item.description),
- bookmarkPath(item.bookmarkPath)
+ description(item.description)
{};
-
+
UrlSearchItem() : type(UrlSearchItem::Undefined),
url(QString()),
title(QString()),
- visitDateTime(QDateTime()),
- visitCount(0),
- description(QString()),
- bookmarkPath(QString())
+ description(QString())
{};
UrlSearchItem(const int &_type,
const QString &_url,
const QString &_title = QString(),
- const QDateTime &visitDateTime = QDateTime(),
- const int &visitCount = 0,
- const QString &description = QString(),
- const QString &bookmarkPath = QString()
+ const QString &description = QString()
)
: type(_type),
url(_url),
title(_title),
- visitDateTime(visitDateTime),
- visitCount(visitCount),
- description(description),
- bookmarkPath(bookmarkPath)
+ description(description)
{};
inline bool operator==(const UrlSearchItem &i) const
{
return i.url == url;//TODO && i.title == title;
- }
-
- inline bool operator <(const UrlSearchItem &i) const
- {
- return visitDateTime < i.visitDateTime;
- }
-
- inline bool operator >(const UrlSearchItem &i) const
- {
- return visitDateTime > i.visitDateTime;
- }
+ }
};
typedef QList <UrlSearchItem> UrlSearchList;
@@ -137,31 +110,9 @@ private:
UrlSearchItem privilegedItem(UrlSearchList* list);
static QRegExp _browseRegexp;
+ static QRegExp _searchEnginesRegexp;
};
// ------------------------------------------------------------------------------
-
-/**
- * This class represents all searchable item for the awesomebar.
- */
-class AwesomeUrlCompletion// : public KCompletion
-{
-public:
- AwesomeUrlCompletion();
- ~AwesomeUrlCompletion();
- void addItem(const UrlSearchItem& item);
- void removeItem(const UrlSearchItem& item);
- void setOrder(KCompletion::CompOrder);
- void updateTitle(const UrlSearchItem& item, const QString& newTitle);
- void clear();
- UrlSearchList substringCompletion(const QString& completionString);
-
-private:
- UrlSearchList m_items;
- UrlSearchList m_filteredItems;
- bool m_resetCompletion;
- QString m_lastCompletionString;
-};
-
#endif // URL_RESOLVER_H