diff options
author | Andrea Diamantini <adjam7@gmail.com> | 2010-05-16 23:04:24 +0200 |
---|---|---|
committer | Andrea Diamantini <adjam7@gmail.com> | 2010-05-16 23:04:24 +0200 |
commit | f0817bac39d72b7d42c2ca867fdff59ad5333d7a (patch) | |
tree | f9b8dd7fe1740e816615405c1d738702c0f043e2 /src/urlbar | |
parent | Merge commit 'refs/merge-requests/2264' of git://gitorious.org/rekonq/mainlin... (diff) | |
download | rekonq-f0817bac39d72b7d42c2ca867fdff59ad5333d7a.tar.xz |
Removed pointers use in UrlResolver class
Diffstat (limited to 'src/urlbar')
-rw-r--r-- | src/urlbar/urlresolver.cpp | 16 | ||||
-rw-r--r-- | src/urlbar/urlresolver.h | 2 |
2 files changed, 12 insertions, 6 deletions
diff --git a/src/urlbar/urlresolver.cpp b/src/urlbar/urlresolver.cpp index 1376ca2c..5f4f86a3 100644 --- a/src/urlbar/urlresolver.cpp +++ b/src/urlbar/urlresolver.cpp @@ -46,7 +46,8 @@ #define MAX_ELEMENTS 9 -// NOTE default kurifilter plugin list (at least in my box) +// NOTE +// default kurifilter plugin list (at least in my box): // 1. "kshorturifilter" // 2. "kurisearchfilter" // 3. "localdomainurifilter" @@ -60,14 +61,19 @@ bool UrlSearchItem::operator==(const UrlSearchItem &i) const } -QRegExp* UrlResolver::_browseRegexp = NULL; +// ------------------------------------------------------------------------ + + +QRegExp UrlResolver::_browseRegexp; UrlResolver::UrlResolver(const QString &typedUrl) : _typedString(typedUrl.trimmed()) { - if (_browseRegexp==NULL) + if ( _browseRegexp.isEmpty() ) { + kDebug() << "browse regexp empty. Setting value.."; + QString protocol = "^(http://|https://|file://|ftp://)"; QString ipv4 = "^0*([1-9]?\\d|1\\d\\d|2[0-4]\\d|25[0-5])\\.0*([1-9]?\\d|1\\d\\d|2[0-4]\\d|25[0-5])"\ @@ -83,7 +89,7 @@ UrlResolver::UrlResolver(const QString &typedUrl) "y[etu]|z[amw]|aero|arpa|biz|com|coop|edu|info|int|gov|mil|museum|name|net|org|"\ "pro)"; - _browseRegexp = new QRegExp("(" + protocol + ")|(" + address + ")|(" + ipv6 + ")|(" + ipv4 +")"); + _browseRegexp = QRegExp("(" + protocol + ")|(" + address + ")|(" + ipv6 + ")|(" + ipv4 +")"); } } @@ -99,7 +105,7 @@ UrlSearchList UrlResolver::orderedSearchItems() UrlSearchList list; - if(_browseRegexp->indexIn(_typedString) != -1) + if(_browseRegexp.indexIn(_typedString) != -1) { list << qurlFromUserInputResolution(); list << webSearchesResolution(); diff --git a/src/urlbar/urlresolver.h b/src/urlbar/urlresolver.h index 7d3db967..0c7df8c8 100644 --- a/src/urlbar/urlresolver.h +++ b/src/urlbar/urlresolver.h @@ -84,7 +84,7 @@ private: UrlSearchList bookmarksResolution(); UrlSearchList placeTypedDomaineNameOnTop(UrlSearchList list); - static QRegExp *_browseRegexp; + static QRegExp _browseRegexp; }; #endif // URL_RESOLVER_H |