Permalink
Browse files

Qt: Change QUrl(s) to QString(s) to improve comparisons

  • Loading branch information...
3unjee committed Jan 22, 2019
1 parent 841c95f commit e02f01b86b99ee8bae334b581d211c506e930499
Showing with 12 additions and 11 deletions.
  1. +6 −5 content/PanelBrowse.qml
  2. +4 −4 src/controllers/ControllerCore.cpp
  3. +2 −2 src/controllers/ControllerCore.h
@@ -522,15 +522,15 @@ MouseArea

pInitSearch(query);

var source = controllerNetwork.encodedUrl(query);
var source;

if (pBrowsing)
{
if (pItemBrowse == null || pBrowseIndex == -1)
{
if (panelBrowse.query == "")
{
source = controllerPlaylist.generateSource(source);
source = controllerPlaylist.generateSource(query);

pFolderBrowse.loadSource(source, false);

@@ -557,7 +557,7 @@ MouseArea
else
{
source = controllerPlaylist.createSource(pSearchEngine,
"search", "urls", source);
"search", "urls", query);

if (pFolderBrowse.source == source)
{
@@ -576,16 +576,17 @@ MouseArea
return;
}

source = pSiteQuery(pItemBrowse.title, source);
source = pSiteQuery(pItemBrowse.title, query);

source = controllerPlaylist.createSource(pSearchEngine,
"search", "site", source);
}
else if (pItemBrowse)
{
source = controllerPlaylist.createSource(pFolderBrowse.label,
"search", pItemBrowse.label, source);
"search", pItemBrowse.label, query);
}
else source = query;

if (pItemBrowse.source == source)
{
@@ -618,7 +618,7 @@ ControllerCore::ControllerCore() : WController()
else return false;
}

/* Q_INVOKABLE static */ int ControllerCore::urlType(const QUrl & url)
/* Q_INVOKABLE static */ int ControllerCore::urlType(const QString & url)
{
return wControllerPlaylist->urlType(url);
}
@@ -644,8 +644,8 @@ ControllerCore::ControllerCore() : WController()

//-------------------------------------------------------------------------------------------------

/* Q_INVOKABLE static */ int ControllerCore::getPlaylistType(WBackendNet * backend,
const QUrl & url)
/* Q_INVOKABLE static */ int ControllerCore::getPlaylistType(WBackendNet * backend,
const QString & url)
{
return backend->getPlaylistType(url);
}
@@ -709,7 +709,7 @@ ControllerCore::ControllerCore() : WController()
{
if (playlist == NULL || index == -1) return;

QList<QUrl> urls;
QStringList urls;

int count = 3;

@@ -104,7 +104,7 @@ class ControllerCore : public WController

Q_INVOKABLE static bool checkUrl(const QString & text);

Q_INVOKABLE static int urlType(const QUrl & url);
Q_INVOKABLE static int urlType(const QString & url);

//---------------------------------------------------------------------------------------------

@@ -113,7 +113,7 @@ class ControllerCore : public WController
Q_INVOKABLE static int itemState (WLibraryFolder * folder, int index);
Q_INVOKABLE static int itemStateQuery(WLibraryFolder * folder, int index);

Q_INVOKABLE static int getPlaylistType(WBackendNet * backend, const QUrl & url);
Q_INVOKABLE static int getPlaylistType(WBackendNet * backend, const QString & url);

Q_INVOKABLE static WLibraryFolder * createFolder (int type = WLibraryItem::Folder);
Q_INVOKABLE static WPlaylist * createPlaylist(int type = WLibraryItem::Playlist);

0 comments on commit e02f01b

Please sign in to comment.