aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArne Morten Kvarving <cptspiff@gmail.com>2014-06-25 14:37:12 +0200
committerJonathan Marshall <jmarshall@xbmc.org>2014-07-14 08:33:01 +1200
commitfcb0fa0e7547b408a438bdb0bdb4af2fe21fdcb2 (patch)
tree98eea362a1933e228affa1f80ca176939ceabc77
parent45b715a6515c1ec835fba972e097fb38b4e2baf5 (diff)
[stdstring] get rid of CStdString in dialogs/
-rw-r--r--xbmc/dialogs/GUIDialogBoxBase.cpp6
-rw-r--r--xbmc/dialogs/GUIDialogBoxBase.h6
-rw-r--r--xbmc/dialogs/GUIDialogButtonMenu.cpp4
-rw-r--r--xbmc/dialogs/GUIDialogButtonMenu.h2
-rw-r--r--xbmc/dialogs/GUIDialogCache.cpp6
-rw-r--r--xbmc/dialogs/GUIDialogCache.h14
-rw-r--r--xbmc/dialogs/GUIDialogContextMenu.cpp42
-rw-r--r--xbmc/dialogs/GUIDialogContextMenu.h20
-rw-r--r--xbmc/dialogs/GUIDialogFavourites.cpp6
-rw-r--r--xbmc/dialogs/GUIDialogFileBrowser.cpp54
-rw-r--r--xbmc/dialogs/GUIDialogFileBrowser.h26
-rw-r--r--xbmc/dialogs/GUIDialogGamepad.cpp26
-rw-r--r--xbmc/dialogs/GUIDialogGamepad.h12
-rw-r--r--xbmc/dialogs/GUIDialogKaiToast.cpp8
-rw-r--r--xbmc/dialogs/GUIDialogKaiToast.h16
-rw-r--r--xbmc/dialogs/GUIDialogKeyboardGeneric.cpp32
-rw-r--r--xbmc/dialogs/GUIDialogKeyboardGeneric.h14
-rw-r--r--xbmc/dialogs/GUIDialogMediaFilter.cpp8
-rw-r--r--xbmc/dialogs/GUIDialogMediaSource.cpp28
-rw-r--r--xbmc/dialogs/GUIDialogMediaSource.h12
-rw-r--r--xbmc/dialogs/GUIDialogNumeric.cpp52
-rw-r--r--xbmc/dialogs/GUIDialogNumeric.h24
-rw-r--r--xbmc/dialogs/GUIDialogPlayEject.cpp2
-rw-r--r--xbmc/dialogs/GUIDialogSelect.cpp6
-rw-r--r--xbmc/dialogs/GUIDialogSelect.h4
-rw-r--r--xbmc/dialogs/GUIDialogSlider.cpp4
-rw-r--r--xbmc/dialogs/GUIDialogSlider.h4
-rw-r--r--xbmc/dialogs/GUIDialogSmartPlaylistEditor.cpp30
-rw-r--r--xbmc/dialogs/GUIDialogSmartPlaylistEditor.h12
-rw-r--r--xbmc/dialogs/GUIDialogSmartPlaylistRule.cpp54
-rw-r--r--xbmc/dialogs/GUIDialogSmartPlaylistRule.h4
-rw-r--r--xbmc/dialogs/GUIDialogSubMenu.cpp4
-rw-r--r--xbmc/dialogs/GUIDialogSubMenu.h2
-rw-r--r--xbmc/dialogs/GUIDialogTextViewer.h8
-rw-r--r--xbmc/dialogs/GUIDialogYesNo.cpp4
-rw-r--r--xbmc/dialogs/GUIDialogYesNo.h4
-rw-r--r--xbmc/network/GUIDialogNetworkSetup.cpp47
-rw-r--r--xbmc/network/GUIDialogNetworkSetup.h16
38 files changed, 317 insertions, 306 deletions
diff --git a/xbmc/dialogs/GUIDialogBoxBase.cpp b/xbmc/dialogs/GUIDialogBoxBase.cpp
index 4e6f36fb9c..297672e9f5 100644
--- a/xbmc/dialogs/GUIDialogBoxBase.cpp
+++ b/xbmc/dialogs/GUIDialogBoxBase.cpp
@@ -31,7 +31,7 @@ using namespace std;
#define CONTROL_TEXTBOX 9
#define CONTROL_CHOICES_START 10
-CGUIDialogBoxBase::CGUIDialogBoxBase(int id, const CStdString &xmlFile)
+CGUIDialogBoxBase::CGUIDialogBoxBase(int id, const std::string &xmlFile)
: CGUIDialog(id, xmlFile)
{
m_bConfirmed = false;
@@ -180,7 +180,7 @@ void CGUIDialogBoxBase::OnDeinitWindow(int nextWindowID)
CGUIDialog::OnDeinitWindow(nextWindowID);
}
-CStdString CGUIDialogBoxBase::GetLocalized(const CVariant &var) const
+std::string CGUIDialogBoxBase::GetLocalized(const CVariant &var) const
{
if (var.isString())
return var.asString();
@@ -189,7 +189,7 @@ CStdString CGUIDialogBoxBase::GetLocalized(const CVariant &var) const
return "";
}
-CStdString CGUIDialogBoxBase::GetDefaultLabel(int controlId) const
+std::string CGUIDialogBoxBase::GetDefaultLabel(int controlId) const
{
int labelId = GetDefaultLabelID(controlId);
return labelId != -1 ? g_localizeStrings.Get(labelId) : "";
diff --git a/xbmc/dialogs/GUIDialogBoxBase.h b/xbmc/dialogs/GUIDialogBoxBase.h
index 7979b41246..94e76b4171 100644
--- a/xbmc/dialogs/GUIDialogBoxBase.h
+++ b/xbmc/dialogs/GUIDialogBoxBase.h
@@ -33,7 +33,7 @@ class CGUIDialogBoxBase :
public CGUIDialog
{
public:
- CGUIDialogBoxBase(int id, const CStdString &xmlFile);
+ CGUIDialogBoxBase(int id, const std::string &xmlFile);
virtual ~CGUIDialogBoxBase(void);
virtual bool OnMessage(CGUIMessage& message);
bool IsConfirmed() const;
@@ -42,14 +42,14 @@ public:
void SetHeading(const CVariant &heading);
void SetChoice(int iButton, const CVariant &choice);
protected:
- CStdString GetDefaultLabel(int controlId) const;
+ std::string GetDefaultLabel(int controlId) const;
virtual int GetDefaultLabelID(int controlId) const;
/*! \brief Get a localized string from a variant
If the varaint is already a string we return directly, else if it's an integer we return the corresponding
localized string.
\param var the variant to localize.
*/
- CStdString GetLocalized(const CVariant &var) const;
+ std::string GetLocalized(const CVariant &var) const;
virtual void Process(unsigned int currentTime, CDirtyRegionList &dirtyregions);
virtual void OnInitWindow();
diff --git a/xbmc/dialogs/GUIDialogButtonMenu.cpp b/xbmc/dialogs/GUIDialogButtonMenu.cpp
index 2a286b438f..613b25fafc 100644
--- a/xbmc/dialogs/GUIDialogButtonMenu.cpp
+++ b/xbmc/dialogs/GUIDialogButtonMenu.cpp
@@ -22,8 +22,8 @@
#define CONTROL_BUTTON_LABEL 3100
-CGUIDialogButtonMenu::CGUIDialogButtonMenu(int id, const CStdString &xmlFile)
-: CGUIDialog(id, xmlFile)
+CGUIDialogButtonMenu::CGUIDialogButtonMenu(int id, const std::string &xmlFile)
+: CGUIDialog(id, xmlFile.c_str())
{
m_loadType = KEEP_IN_MEMORY;
}
diff --git a/xbmc/dialogs/GUIDialogButtonMenu.h b/xbmc/dialogs/GUIDialogButtonMenu.h
index 7342b2d7ba..921011e678 100644
--- a/xbmc/dialogs/GUIDialogButtonMenu.h
+++ b/xbmc/dialogs/GUIDialogButtonMenu.h
@@ -26,7 +26,7 @@ class CGUIDialogButtonMenu :
public CGUIDialog
{
public:
- CGUIDialogButtonMenu(int id = WINDOW_DIALOG_BUTTON_MENU, const CStdString &xmlFile = "DialogButtonMenu.xml");
+ CGUIDialogButtonMenu(int id = WINDOW_DIALOG_BUTTON_MENU, const std::string &xmlFile = "DialogButtonMenu.xml");
virtual ~CGUIDialogButtonMenu(void);
virtual bool OnMessage(CGUIMessage &message);
virtual void FrameMove();
diff --git a/xbmc/dialogs/GUIDialogCache.cpp b/xbmc/dialogs/GUIDialogCache.cpp
index 1a7d043168..4049074c7b 100644
--- a/xbmc/dialogs/GUIDialogCache.cpp
+++ b/xbmc/dialogs/GUIDialogCache.cpp
@@ -28,7 +28,7 @@
#include "threads/SingleLock.h"
#include "utils/TimeUtils.h"
-CGUIDialogCache::CGUIDialogCache(DWORD dwDelay, const CStdString& strHeader, const CStdString& strMsg) : CThread("GUIDialogCache")
+CGUIDialogCache::CGUIDialogCache(DWORD dwDelay, const std::string& strHeader, const std::string& strMsg) : CThread("GUIDialogCache")
{
m_strHeader = strHeader;
m_strLinePrev = strMsg;
@@ -85,7 +85,7 @@ void CGUIDialogCache::OpenDialog()
bSentCancel = false;
}
-void CGUIDialogCache::SetHeader(const CStdString& strHeader)
+void CGUIDialogCache::SetHeader(const std::string& strHeader)
{
m_strHeader = strHeader;
}
@@ -95,7 +95,7 @@ void CGUIDialogCache::SetHeader(int nHeader)
SetHeader(g_localizeStrings.Get(nHeader));
}
-void CGUIDialogCache::SetMessage(const CStdString& strMessage)
+void CGUIDialogCache::SetMessage(const std::string& strMessage)
{
if (m_pDlg)
{
diff --git a/xbmc/dialogs/GUIDialogCache.h b/xbmc/dialogs/GUIDialogCache.h
index b4f92441ca..cd585bc187 100644
--- a/xbmc/dialogs/GUIDialogCache.h
+++ b/xbmc/dialogs/GUIDialogCache.h
@@ -23,18 +23,18 @@
#include "filesystem/File.h"
#include "threads/Thread.h"
#include "threads/SystemClock.h"
-#include "utils/StdString.h"
+#include <string>
class CGUIDialogProgress;
class CGUIDialogCache : public CThread, public XFILE::IFileCallback
{
public:
- CGUIDialogCache(DWORD dwDelay = 0, const CStdString& strHeader="", const CStdString& strMsg="");
+ CGUIDialogCache(DWORD dwDelay = 0, const std::string& strHeader="", const std::string& strMsg="");
virtual ~CGUIDialogCache();
- void SetHeader(const CStdString& strHeader);
+ void SetHeader(const std::string& strHeader);
void SetHeader(int nHeader);
- void SetMessage(const CStdString& strMessage);
+ void SetMessage(const std::string& strMessage);
bool IsCanceled() const;
void ShowProgressBar(bool bOnOff);
void SetPercentage(int iPercentage);
@@ -50,9 +50,9 @@ protected:
XbmcThreads::EndTime m_endtime;
CGUIDialogProgress* m_pDlg;
- CStdString m_strLinePrev;
- CStdString m_strLinePrev2;
- CStdString m_strHeader;
+ std::string m_strLinePrev;
+ std::string m_strLinePrev2;
+ std::string m_strHeader;
bool bSentCancel;
bool m_bOpenTried;
};
diff --git a/xbmc/dialogs/GUIDialogContextMenu.cpp b/xbmc/dialogs/GUIDialogContextMenu.cpp
index 2b24df488f..5049a35d63 100644
--- a/xbmc/dialogs/GUIDialogContextMenu.cpp
+++ b/xbmc/dialogs/GUIDialogContextMenu.cpp
@@ -58,14 +58,14 @@ using namespace std;
#define BUTTON_START 1001
#define BUTTON_END (BUTTON_START + (int)m_buttons.size() - 1)
-void CContextButtons::Add(unsigned int button, const CStdString &label)
+void CContextButtons::Add(unsigned int button, const std::string &label)
{
- push_back(pair<unsigned int, CStdString>(button, label));
+ push_back(pair<unsigned int, std::string>(button, label));
}
void CContextButtons::Add(unsigned int button, int label)
{
- push_back(pair<unsigned int, CStdString>(button, g_localizeStrings.Get(label)));
+ push_back(pair<unsigned int, std::string>(button, g_localizeStrings.Get(label)));
}
CGUIDialogContextMenu::CGUIDialogContextMenu(void)
@@ -202,7 +202,7 @@ float CGUIDialogContextMenu::GetWidth() const
return CGUIDialog::GetWidth();
}
-bool CGUIDialogContextMenu::SourcesMenu(const CStdString &strType, const CFileItemPtr item, float posX, float posY)
+bool CGUIDialogContextMenu::SourcesMenu(const std::string &strType, const CFileItemPtr item, float posX, float posY)
{
// TODO: This should be callable even if we don't have any valid items
if (!item)
@@ -218,7 +218,7 @@ bool CGUIDialogContextMenu::SourcesMenu(const CStdString &strType, const CFileIt
return false;
}
-void CGUIDialogContextMenu::GetContextButtons(const CStdString &type, const CFileItemPtr item, CContextButtons &buttons)
+void CGUIDialogContextMenu::GetContextButtons(const std::string &type, const CFileItemPtr item, CContextButtons &buttons)
{
// Add buttons to the ContextMenu that should be visible for both sources and autosourced items
if (item && item->IsRemovable())
@@ -297,7 +297,7 @@ void CGUIDialogContextMenu::GetContextButtons(const CStdString &type, const CFil
buttons.Add(CONTEXT_BUTTON_REACTIVATE_LOCK, 12353);
}
-bool CGUIDialogContextMenu::OnContextButton(const CStdString &type, const CFileItemPtr item, CONTEXT_BUTTON button)
+bool CGUIDialogContextMenu::OnContextButton(const std::string &type, const CFileItemPtr item, CONTEXT_BUTTON button)
{
// Add Source doesn't require a valid share
if (button == CONTEXT_BUTTON_ADD_SOURCE)
@@ -369,10 +369,10 @@ bool CGUIDialogContextMenu::OnContextButton(const CStdString &type, const CFileI
// prompt user if they want to really delete the source
if (CGUIDialogYesNo::ShowAndGetInput(751, 0, 750, 0))
{ // check default before we delete, as deletion will kill the share object
- CStdString defaultSource(GetDefaultShareNameByType(type));
+ std::string defaultSource(GetDefaultShareNameByType(type));
if (!defaultSource.empty())
{
- if (share->strName.Equals(defaultSource))
+ if (share->strName == defaultSource)
ClearDefault(type);
}
CMediaSourceSettings::Get().DeleteSource(type, share->strName, share->strPath);
@@ -424,7 +424,7 @@ bool CGUIDialogContextMenu::OnContextButton(const CStdString &type, const CFileI
items.Add(current);
}
// see if there's a local thumb for this item
- CStdString folderThumb = item->GetFolderThumb();
+ std::string folderThumb = item->GetFolderThumb();
if (XFILE::CFile::Exists(folderThumb))
{
CFileItemPtr local(new CFileItem("thumb://Local", false));
@@ -438,7 +438,7 @@ bool CGUIDialogContextMenu::OnContextButton(const CStdString &type, const CFileI
nothumb->SetLabel(g_localizeStrings.Get(20018));
items.Add(nothumb);
- CStdString strThumb;
+ std::string strThumb;
VECSOURCES shares;
g_mediaManager.GetLocalDrives(shares);
if (!CGUIDialogFileBrowser::ShowAndGetImage(items, shares, g_localizeStrings.Get(1030), strThumb))
@@ -539,7 +539,7 @@ bool CGUIDialogContextMenu::OnContextButton(const CStdString &type, const CFileI
return false;
std::string strNewPW;
- CStdString strNewLockMode;
+ std::string strNewLockMode;
if (CGUIDialogLockSettings::ShowAndGetLock(share->m_iLockMode,strNewPW))
strNewLockMode = StringUtils::Format("%i",share->m_iLockMode);
else
@@ -559,7 +559,7 @@ bool CGUIDialogContextMenu::OnContextButton(const CStdString &type, const CFileI
return false;
}
-CMediaSource *CGUIDialogContextMenu::GetShare(const CStdString &type, const CFileItem *item)
+CMediaSource *CGUIDialogContextMenu::GetShare(const std::string &type, const CFileItem *item)
{
VECSOURCES *shares = CMediaSourceSettings::Get().GetSources(type);
if (!shares || !item) return NULL;
@@ -619,10 +619,10 @@ void CGUIDialogContextMenu::OnDeinitWindow(int nextWindowID)
CGUIDialog::OnDeinitWindow(nextWindowID);
}
-CStdString CGUIDialogContextMenu::GetDefaultShareNameByType(const CStdString &strType)
+std::string CGUIDialogContextMenu::GetDefaultShareNameByType(const std::string &strType)
{
VECSOURCES *pShares = CMediaSourceSettings::Get().GetSources(strType);
- CStdString strDefault = CMediaSourceSettings::Get().GetDefaultSource(strType);
+ std::string strDefault = CMediaSourceSettings::Get().GetDefaultSource(strType);
if (!pShares) return "";
@@ -634,28 +634,28 @@ CStdString CGUIDialogContextMenu::GetDefaultShareNameByType(const CStdString &st
return pShares->at(iIndex).strName;
}
-void CGUIDialogContextMenu::SetDefault(const CStdString &strType, const CStdString &strDefault)
+void CGUIDialogContextMenu::SetDefault(const std::string &strType, const std::string &strDefault)
{
CMediaSourceSettings::Get().SetDefaultSource(strType, strDefault);
CMediaSourceSettings::Get().Save();
}
-void CGUIDialogContextMenu::ClearDefault(const CStdString &strType)
+void CGUIDialogContextMenu::ClearDefault(const std::string &strType)
{
SetDefault(strType, "");
}
-void CGUIDialogContextMenu::SwitchMedia(const CStdString& strType, const CStdString& strPath)
+void CGUIDialogContextMenu::SwitchMedia(const std::string& strType, const std::string& strPath)
{
// create menu
CContextButtons choices;
- if (!strType.Equals("music"))
+ if (strType != "music")
choices.Add(WINDOW_MUSIC_FILES, 2);
- if (!strType.Equals("video"))
+ if (strType != "video")
choices.Add(WINDOW_VIDEO_FILES, 3);
- if (!strType.Equals("pictures"))
+ if (strType != "pictures")
choices.Add(WINDOW_PICTURES, 1);
- if (!strType.Equals("files"))
+ if (strType != "files")
choices.Add(WINDOW_FILES, 7);
int window = ShowAndGetChoice(choices);
diff --git a/xbmc/dialogs/GUIDialogContextMenu.h b/xbmc/dialogs/GUIDialogContextMenu.h
index f0c614b648..b96d56743d 100644
--- a/xbmc/dialogs/GUIDialogContextMenu.h
+++ b/xbmc/dialogs/GUIDialogContextMenu.h
@@ -141,10 +141,10 @@ enum CONTEXT_BUTTON { CONTEXT_BUTTON_CANCELLED = 0,
CONTEXT_BUTTON_USER10
};
-class CContextButtons : public std::vector< std::pair<unsigned int, CStdString> >
+class CContextButtons : public std::vector< std::pair<unsigned int, std::string> >
{
public:
- void Add(unsigned int, const CStdString &label);
+ void Add(unsigned int, const std::string &label);
void Add(unsigned int, int label);
};
@@ -158,11 +158,11 @@ public:
virtual bool OnAction(const CAction& action);
virtual void SetPosition(float posX, float posY);
- static bool SourcesMenu(const CStdString &strType, const CFileItemPtr item, float posX, float posY);
- static void SwitchMedia(const CStdString& strType, const CStdString& strPath);
+ static bool SourcesMenu(const std::string &strType, const CFileItemPtr item, float posX, float posY);
+ static void SwitchMedia(const std::string& strType, const std::string& strPath);
- static void GetContextButtons(const CStdString &type, const CFileItemPtr item, CContextButtons &buttons);
- static bool OnContextButton(const CStdString &type, const CFileItemPtr item, CONTEXT_BUTTON button);
+ static void GetContextButtons(const std::string &type, const CFileItemPtr item, CContextButtons &buttons);
+ static bool OnContextButton(const std::string &type, const CFileItemPtr item, CONTEXT_BUTTON button);
/*! \brief Show the context menu with the given choices
\param choices the choices available for the user.
@@ -183,10 +183,10 @@ protected:
virtual void OnInitWindow();
virtual void OnWindowLoaded();
virtual void OnDeinitWindow(int nextWindowID);
- static CStdString GetDefaultShareNameByType(const CStdString &strType);
- static void SetDefault(const CStdString &strType, const CStdString &strDefault);
- static void ClearDefault(const CStdString &strType);
- static CMediaSource *GetShare(const CStdString &type, const CFileItem *item);
+ static std::string GetDefaultShareNameByType(const std::string &strType);
+ static void SetDefault(const std::string &strType, const std::string &strDefault);
+ static void ClearDefault(const std::string &strType);
+ static CMediaSource *GetShare(const std::string &type, const CFileItem *item);
private:
float m_coordX, m_coordY;
diff --git a/xbmc/dialogs/GUIDialogFavourites.cpp b/xbmc/dialogs/GUIDialogFavourites.cpp
index 8df3aa4a03..a22703976b 100644
--- a/xbmc/dialogs/GUIDialogFavourites.cpp
+++ b/xbmc/dialogs/GUIDialogFavourites.cpp
@@ -103,7 +103,7 @@ void CGUIDialogFavourites::OnClick(int item)
// grab our message, close the dialog, and send
CFileItemPtr pItem = (*m_favourites)[item];
- CStdString execute(pItem->GetPath());
+ std::string execute(pItem->GetPath());
Close();
@@ -181,7 +181,7 @@ void CGUIDialogFavourites::OnRename(int item)
if (item < 0 || item >= m_favourites->Size())
return;
- CStdString label((*m_favourites)[item]->GetLabel());
+ std::string label((*m_favourites)[item]->GetLabel());
if (CGUIKeyboardFactory::ShowAndGetInput(label, g_localizeStrings.Get(16008), false))
(*m_favourites)[item]->SetLabel(label);
@@ -214,7 +214,7 @@ void CGUIDialogFavourites::OnSetThumb(int item)
none->SetLabel(g_localizeStrings.Get(20018));
items.Add(none);
- CStdString thumb;
+ std::string thumb;
VECSOURCES sources;
g_mediaManager.GetLocalDrives(sources);
if (!CGUIDialogFileBrowser::ShowAndGetImage(items, sources, g_localizeStrings.Get(1030), thumb))
diff --git a/xbmc/dialogs/GUIDialogFileBrowser.cpp b/xbmc/dialogs/GUIDialogFileBrowser.cpp
index 16c7791bb7..02860e4cca 100644
--- a/xbmc/dialogs/GUIDialogFileBrowser.cpp
+++ b/xbmc/dialogs/GUIDialogFileBrowser.cpp
@@ -155,7 +155,7 @@ bool CGUIDialogFileBrowser::OnMessage(CGUIMessage& message)
bFool = true;
if (iSource > -1 && iSource < (int)m_shares.size())
{
- if (m_shares[iSource].strPath.Equals(m_selectedPath))
+ if (URIUtils::PathEquals(m_shares[iSource].strPath, m_selectedPath))
bFool = false;
}
@@ -207,13 +207,13 @@ bool CGUIDialogFileBrowser::OnMessage(CGUIMessage& message)
{
int iItem = m_viewControl.GetSelectedItem();
- CStdString strPath;
+ std::string strPath;
if (iItem == 0)
strPath = m_selectedPath;
else
strPath = (*m_vecItems)[iItem]->GetPath();
- CStdString strTest = URIUtils::AddFileToFolder(strPath, "1");
+ std::string strTest = URIUtils::AddFileToFolder(strPath, "1");
CFile file;
if (file.OpenForWrite(strTest,true))
{
@@ -248,10 +248,10 @@ bool CGUIDialogFileBrowser::OnMessage(CGUIMessage& message)
}
else if (message.GetSenderId() == CONTROL_NEWFOLDER)
{
- CStdString strInput;
+ std::string strInput;
if (CGUIKeyboardFactory::ShowAndGetInput(strInput,g_localizeStrings.Get(119),false))
{
- CStdString strPath = URIUtils::AddFileToFolder(m_vecItems->GetPath(), strInput);
+ std::string strPath = URIUtils::AddFileToFolder(m_vecItems->GetPath(), strInput);
if (CDirectory::Create(strPath))
Update(m_vecItems->GetPath());
else
@@ -337,7 +337,7 @@ void CGUIDialogFileBrowser::OnSort()
m_vecItems->Sort(SortByLabel, SortOrderAscending);
}
-void CGUIDialogFileBrowser::Update(const CStdString &strDirectory)
+void CGUIDialogFileBrowser::Update(const std::string &strDirectory)
{
const CURL pathToUrl(strDirectory);
@@ -345,7 +345,7 @@ void CGUIDialogFileBrowser::Update(const CStdString &strDirectory)
m_thumbLoader.StopThread();
// get selected item
int iItem = m_viewControl.GetSelectedItem();
- CStdString strSelectedItem = "";
+ std::string strSelectedItem;
if (iItem >= 0 && iItem < m_vecItems->Size())
{
CFileItemPtr pItem = (*m_vecItems)[iItem];
@@ -360,7 +360,7 @@ void CGUIDialogFileBrowser::Update(const CStdString &strDirectory)
if (!m_singleList)
{
CFileItemList items;
- CStdString strParentPath;
+ std::string strParentPath;
if (!m_rootDir.GetDirectory(pathToUrl, items, m_useFileDirectories))
{
@@ -368,7 +368,7 @@ void CGUIDialogFileBrowser::Update(const CStdString &strDirectory)
// We assume, we can get the parent
// directory again
- CStdString strParentPath = m_history.GetParentPath();
+ std::string strParentPath = m_history.GetParentPath();
m_history.RemoveParentPath();
Update(strParentPath);
return;
@@ -446,7 +446,7 @@ void CGUIDialogFileBrowser::Update(const CStdString &strDirectory)
m_viewControl.SetItems(*m_vecItems);
m_viewControl.SetCurrentView((m_browsingForImages && CAutoSwitch::ByFileCount(*m_vecItems)) ? DEFAULT_VIEW_ICONS : DEFAULT_VIEW_LIST);
- CStdString strPath2 = m_Directory->GetPath();
+ std::string strPath2 = m_Directory->GetPath();
URIUtils::RemoveSlashAtEnd(strPath2);
strSelectedItem = m_history.GetSelectedItem(strPath2==""?"empty":strPath2);
@@ -493,7 +493,7 @@ void CGUIDialogFileBrowser::FrameMove()
{
// Update the current path label
CURL url(m_selectedPath);
- CStdString safePath = url.GetWithoutUserDetails();
+ std::string safePath = url.GetWithoutUserDetails();
SET_CONTROL_LABEL(CONTROL_LABEL_PATH, safePath);
}
if ((!m_browsingForFolders && (*m_vecItems)[item]->m_bIsFolder) || ((*m_vecItems)[item]->GetPath() == "image://Browse"))
@@ -528,7 +528,7 @@ void CGUIDialogFileBrowser::OnClick(int iItem)
{
if ( iItem < 0 || iItem >= (int)m_vecItems->Size() ) return ;
CFileItemPtr pItem = (*m_vecItems)[iItem];
- CStdString strPath = pItem->GetPath();
+ std::string strPath = pItem->GetPath();
if (pItem->m_bIsFolder)
{
@@ -587,7 +587,7 @@ bool CGUIDialogFileBrowser::HaveDiscOrConnection( int iDriveType )
void CGUIDialogFileBrowser::GoParentFolder()
{
- CStdString strPath(m_strParentPath), strOldPath(m_Directory->GetPath());
+ std::string strPath(m_strParentPath), strOldPath(m_Directory->GetPath());
if (strPath.size() == 2)
if (strPath[1] == ':')
URIUtils::AddSlashAtEnd(strPath);
@@ -609,9 +609,9 @@ void CGUIDialogFileBrowser::OnWindowUnload()
m_viewControl.Reset();
}
-bool CGUIDialogFileBrowser::ShowAndGetImage(const CFileItemList &items, const VECSOURCES &shares, const CStdString &heading, CStdString &result, bool* flip, int label)
+bool CGUIDialogFileBrowser::ShowAndGetImage(const CFileItemList &items, const VECSOURCES &shares, const std::string &heading, std::string &result, bool* flip, int label)
{
- CStdString mask = ".png|.jpg|.bmp|.gif|.dds";
+ std::string mask = ".png|.jpg|.bmp|.gif|.dds";
CGUIDialogFileBrowser *browser = new CGUIDialogFileBrowser();
if (!browser)
return false;
@@ -652,17 +652,17 @@ bool CGUIDialogFileBrowser::ShowAndGetImage(const CFileItemList &items, const VE
return confirmed;
}
-bool CGUIDialogFileBrowser::ShowAndGetImage(const VECSOURCES &shares, const CStdString &heading, CStdString &path)
+bool CGUIDialogFileBrowser::ShowAndGetImage(const VECSOURCES &shares, const std::string &heading, std::string &path)
{
return ShowAndGetFile(shares, ".png|.jpg|.bmp|.gif|.tbn|.dds", heading, path, true); // true for use thumbs
}
-bool CGUIDialogFileBrowser::ShowAndGetImageList(const VECSOURCES &shares, const CStdString &heading, std::vector<std::string> &path)
+bool CGUIDialogFileBrowser::ShowAndGetImageList(const VECSOURCES &shares, const std::string &heading, std::vector<std::string> &path)
{
return ShowAndGetFileList(shares, ".png|.jpg|.bmp|.gif|.tbn|.dds", heading, path, true); // true for use thumbs
}
-bool CGUIDialogFileBrowser::ShowAndGetDirectory(const VECSOURCES &shares, const CStdString &heading, CStdString &path, bool bWriteOnly)
+bool CGUIDialogFileBrowser::ShowAndGetDirectory(const VECSOURCES &shares, const std::string &heading, std::string &path, bool bWriteOnly)
{
// an extension mask of "/" ensures that no files are shown
if (bWriteOnly)
@@ -680,7 +680,7 @@ bool CGUIDialogFileBrowser::ShowAndGetDirectory(const VECSOURCES &shares, const
return ShowAndGetFile(shares, "/", heading, path);
}
-bool CGUIDialogFileBrowser::ShowAndGetFile(const VECSOURCES &shares, const CStdString &mask, const CStdString &heading, CStdString &path, bool useThumbs /* = false */, bool useFileDirectories /* = false */)
+bool CGUIDialogFileBrowser::ShowAndGetFile(const VECSOURCES &shares, const std::string &mask, const std::string &heading, std::string &path, bool useThumbs /* = false */, bool useFileDirectories /* = false */)
{
CGUIDialogFileBrowser *browser = new CGUIDialogFileBrowser();
if (!browser)
@@ -692,7 +692,7 @@ bool CGUIDialogFileBrowser::ShowAndGetFile(const VECSOURCES &shares, const CStdS
browser->m_browsingForImages = useThumbs;
browser->SetHeading(heading);
browser->SetSources(shares);
- CStdString strMask = mask;
+ std::string strMask = mask;
if (mask == "/")
browser->m_browsingForFolders=1;
else
@@ -717,7 +717,7 @@ bool CGUIDialogFileBrowser::ShowAndGetFile(const VECSOURCES &shares, const CStdS
}
// same as above, starting in a single directory
-bool CGUIDialogFileBrowser::ShowAndGetFile(const CStdString &directory, const CStdString &mask, const CStdString &heading, CStdString &path, bool useThumbs /* = false */, bool useFileDirectories /* = false */, bool singleList /* = false */)
+bool CGUIDialogFileBrowser::ShowAndGetFile(const std::string &directory, const std::string &mask, const std::string &heading, std::string &path, bool useThumbs /* = false */, bool useFileDirectories /* = false */, bool singleList /* = false */)
{
CGUIDialogFileBrowser *browser = new CGUIDialogFileBrowser();
if (!browser)
@@ -748,7 +748,7 @@ bool CGUIDialogFileBrowser::ShowAndGetFile(const CStdString &directory, const CS
browser->m_vecItems->Add(item);
browser->m_singleList = true;
}
- CStdString strMask = mask;
+ std::string strMask = mask;
if (mask == "/")
browser->m_browsingForFolders=1;
else
@@ -781,7 +781,7 @@ bool CGUIDialogFileBrowser::ShowAndGetFile(const CStdString &directory, const CS
return confirmed;
}
-bool CGUIDialogFileBrowser::ShowAndGetFileList(const VECSOURCES &shares, const CStdString &mask, const CStdString &heading, std::vector<std::string> &path, bool useThumbs /* = false */, bool useFileDirectories /* = false */)
+bool CGUIDialogFileBrowser::ShowAndGetFileList(const VECSOURCES &shares, const std::string &mask, const std::string &heading, std::vector<std::string> &path, bool useThumbs /* = false */, bool useFileDirectories /* = false */)
{
CGUIDialogFileBrowser *browser = new CGUIDialogFileBrowser();
if (!browser)
@@ -810,13 +810,13 @@ bool CGUIDialogFileBrowser::ShowAndGetFileList(const VECSOURCES &shares, const C
return confirmed;
}
-void CGUIDialogFileBrowser::SetHeading(const CStdString &heading)
+void CGUIDialogFileBrowser::SetHeading(const std::string &heading)
{
Initialize();
SET_CONTROL_LABEL(CONTROL_HEADING_LABEL, heading);
}
-bool CGUIDialogFileBrowser::ShowAndGetSource(CStdString &path, bool allowNetworkShares, VECSOURCES* additionalShare /* = NULL */, const CStdString& strType /* = "" */)
+bool CGUIDialogFileBrowser::ShowAndGetSource(std::string &path, bool allowNetworkShares, VECSOURCES* additionalShare /* = NULL */, const std::string& strType /* = "" */)
{
// Technique is
// 1. Show Filebrowser with currently defined local, and optionally the network locations.
@@ -892,7 +892,7 @@ void CGUIDialogFileBrowser::SetSources(const VECSOURCES &shares)
void CGUIDialogFileBrowser::OnAddNetworkLocation()
{
// ok, fire up the network location dialog
- CStdString path;
+ std::string path;
if (CGUIDialogNetworkSetup::ShowAndGetNetworkAddress(path))
{
// verify the path by doing a GetDirectory.
@@ -942,7 +942,7 @@ bool CGUIDialogFileBrowser::OnPopupMenu(int iItem)
{
if (m_addNetworkShareEnabled)
{
- CStdString strOldPath=m_selectedPath,newPath=m_selectedPath;
+ std::string strOldPath=m_selectedPath,newPath=m_selectedPath;
VECSOURCES shares=m_shares;
if (CGUIDialogNetworkSetup::ShowAndGetNetworkAddress(newPath))
{
diff --git a/xbmc/dialogs/GUIDialogFileBrowser.h b/xbmc/dialogs/GUIDialogFileBrowser.h
index 3636beb5d0..d4788e0f09 100644
--- a/xbmc/dialogs/GUIDialogFileBrowser.h
+++ b/xbmc/dialogs/GUIDialogFileBrowser.h
@@ -41,16 +41,16 @@ public:
virtual void OnWindowLoaded();
virtual void OnWindowUnload();
bool IsConfirmed() { return m_bConfirmed; };
- void SetHeading(const CStdString &heading);
+ void SetHeading(const std::string &heading);
- static bool ShowAndGetDirectory(const VECSOURCES &shares, const CStdString &heading, CStdString &path, bool bWriteOnly=false);
- static bool ShowAndGetFile(const VECSOURCES &shares, const CStdString &mask, const CStdString &heading, CStdString &path, bool useThumbs = false, bool useFileDirectories = false);
- static bool ShowAndGetFile(const CStdString &directory, const CStdString &mask, const CStdString &heading, CStdString &path, bool useThumbs = false, bool useFileDirectories = false, bool singleList = false);
- static bool ShowAndGetSource(CStdString &path, bool allowNetworkShares, VECSOURCES* additionalShare = NULL, const CStdString& strType="");
- static bool ShowAndGetFileList(const VECSOURCES &shares, const CStdString &mask, const CStdString &heading, std::vector<std::string> &path, bool useThumbs = false, bool useFileDirectories = false);
- static bool ShowAndGetImage(const VECSOURCES &shares, const CStdString &heading, CStdString &path);
- static bool ShowAndGetImage(const CFileItemList &items, const VECSOURCES &shares, const CStdString &heading, CStdString &path, bool* flip=NULL, int label=21371);
- static bool ShowAndGetImageList(const VECSOURCES &shares, const CStdString &heading, std::vector<std::string> &path);
+ static bool ShowAndGetDirectory(const VECSOURCES &shares, const std::string &heading, std::string &path, bool bWriteOnly=false);
+ static bool ShowAndGetFile(const VECSOURCES &shares, const std::string &mask, const std::string &heading, std::string &path, bool useThumbs = false, bool useFileDirectories = false);
+ static bool ShowAndGetFile(const std::string &directory, const std::string &mask, const std::string &heading, std::string &path, bool useThumbs = false, bool useFileDirectories = false, bool singleList = false);
+ static bool ShowAndGetSource(std::string &path, bool allowNetworkShares, VECSOURCES* additionalShare = NULL, const std::string& strType="");
+ static bool ShowAndGetFileList(const VECSOURCES &shares, const std::string &mask, const std::string &heading, std::vector<std::string> &path, bool useThumbs = false, bool useFileDirectories = false);
+ static bool ShowAndGetImage(const VECSOURCES &shares, const std::string &heading, std::string &path);
+ static bool ShowAndGetImage(const CFileItemList &items, const VECSOURCES &shares, const std::string &heading, std::string &path, bool* flip=NULL, int label=21371);
+ static bool ShowAndGetImageList(const VECSOURCES &shares, const std::string &heading, std::vector<std::string> &path);
void SetSources(const VECSOURCES &shares);
@@ -65,7 +65,7 @@ protected:
void OnClick(int iItem);
void OnSort();
void ClearFileItems();
- void Update(const CStdString &strDirectory);
+ void Update(const std::string &strDirectory);
bool HaveDiscOrConnection( int iDriveType );
bool OnPopupMenu(int iItem);
void OnAddNetworkLocation();
@@ -77,15 +77,15 @@ protected:
XFILE::CVirtualDirectory m_rootDir;
CFileItemList* m_vecItems;
CFileItem* m_Directory;
- CStdString m_strParentPath;
- CStdString m_selectedPath;
+ std::string m_strParentPath;
+ std::string m_selectedPath;
CDirectoryHistory m_history;
int m_browsingForFolders; // 0 - no, 1 - yes, 2 - yes, only writable
bool m_bConfirmed;
int m_bFlip;
bool m_addNetworkShareEnabled;
bool m_flipEnabled;
- CStdString m_addSourceType;
+ std::string m_addSourceType;
bool m_browsingForImages;
bool m_useFileDirectories;
bool m_singleList; // if true, we have no shares or anything
diff --git a/xbmc/dialogs/GUIDialogGamepad.cpp b/xbmc/dialogs/GUIDialogGamepad.cpp
index 8845c1181c..c43959d9aa 100644
--- a/xbmc/dialogs/GUIDialogGamepad.cpp
+++ b/xbmc/dialogs/GUIDialogGamepad.cpp
@@ -80,7 +80,7 @@ bool CGUIDialogGamepad::OnAction(const CAction &action)
break;
}
- CStdString strHiddenInput(m_strUserInput);
+ std::string strHiddenInput(m_strUserInput);
for (int i = 0; i < (int)strHiddenInput.size(); i++)
{
strHiddenInput[i] = m_cHideInputChar;
@@ -102,9 +102,9 @@ bool CGUIDialogGamepad::OnAction(const CAction &action)
m_bConfirmed = false;
m_bCanceled = false;
- CStdString md5pword2 = XBMC::XBMC_MD5::GetMD5(m_strUserInput);
+ std::string md5pword2 = XBMC::XBMC_MD5::GetMD5(m_strUserInput);
- if (!m_strPassword.Equals(md5pword2))
+ if (!StringUtils::EqualsNoCase(m_strPassword, md5pword2))
{
// incorrect password entered
m_iRetries--;
@@ -167,10 +167,10 @@ bool CGUIDialogGamepad::OnMessage(CGUIMessage& message)
// \param dlgHeading String shown on dialog title. Converts to localized string if contains a positive integer.
// \param bHideUserInput Masks user input as asterisks if set as true. Currently not yet implemented.
// \return true if successful display and user input. false if unsuccessful display, no user input, or canceled editing.
-bool CGUIDialogGamepad::ShowAndGetInput(CStdString& aTextString, const CStdString &dlgHeading, bool bHideUserInput)
+bool CGUIDialogGamepad::ShowAndGetInput(std::string& aTextString, const std::string &dlgHeading, bool bHideUserInput)
{
// Prompt user for input
- CStdString strUserInput = "";
+ std::string strUserInput;
if (ShowAndVerifyInput(strUserInput, dlgHeading, aTextString, "", "", true, bHideUserInput))
{
// user entry was blank
@@ -190,10 +190,10 @@ bool CGUIDialogGamepad::ShowAndGetInput(CStdString& aTextString, const CStdStrin
// \brief Show gamepad keypad twice to get and confirm a user-entered password string.
// \param strNewPassword String to preload into the keyboard accumulator. Overwritten with user input if return=true.
// \return true if successful display and user input entry/re-entry. false if unsuccessful display, no user input, or canceled editing.
-bool CGUIDialogGamepad::ShowAndVerifyNewPassword(CStdString& strNewPassword)
+bool CGUIDialogGamepad::ShowAndVerifyNewPassword(std::string& strNewPassword)
{
// Prompt user for password input
- CStdString strUserInput = "";
+ std::string strUserInput;
if (ShowAndVerifyInput(strUserInput, "12340", "12330", "12331", "", true, true))
{
// TODO: Show error to user saying the password entry was blank
@@ -223,9 +223,9 @@ bool CGUIDialogGamepad::ShowAndVerifyNewPassword(CStdString& strNewPassword)
// \param dlgHeading String shown on dialog title. Converts to localized string if contains a positive integer.
// \param iRetries If greater than 0, shows "Incorrect password, %d retries left" on dialog line 2, else line 2 is blank.
// \return 0 if successful display and user input. 1 if unsuccessful input. -1 if no user input or canceled editing.
-int CGUIDialogGamepad::ShowAndVerifyPassword(CStdString& strPassword, const CStdString& dlgHeading, int iRetries)
+int CGUIDialogGamepad::ShowAndVerifyPassword(std::string& strPassword, const std::string& dlgHeading, int iRetries)
{
- CStdString strLine2 = "";
+ std::string strLine2;
if (0 < iRetries)
{
// Show a string telling user they have iRetries retries left
@@ -233,7 +233,7 @@ int CGUIDialogGamepad::ShowAndVerifyPassword(CStdString& strPassword, const CStd
}
// make a copy of strPassword to prevent from overwriting it later
- CStdString strPassTemp = strPassword;
+ std::string strPassTemp = strPassword;
if (ShowAndVerifyInput(strPassTemp, dlgHeading, g_localizeStrings.Get(12330), g_localizeStrings.Get(12331), strLine2, true, true))
{
// user entered correct password
@@ -257,9 +257,9 @@ int CGUIDialogGamepad::ShowAndVerifyPassword(CStdString& strPassword, const CStd
// \param bGetUserInput If set as true and return=true, strToVerify is overwritten with user input string.
// \param bHideInputChars Masks user input as asterisks if set as true. Currently not yet implemented.
// \return true if successful display and user input. false if unsuccessful display, no user input, or canceled editing.
-bool CGUIDialogGamepad::ShowAndVerifyInput(CStdString& strToVerify, const CStdString& dlgHeading,
- const CStdString& dlgLine0, const CStdString& dlgLine1,
- const CStdString& dlgLine2, bool bGetUserInput, bool bHideInputChars)
+bool CGUIDialogGamepad::ShowAndVerifyInput(std::string& strToVerify, const std::string& dlgHeading,
+ const std::string& dlgLine0, const std::string& dlgLine1,
+ const std::string& dlgLine2, bool bGetUserInput, bool bHideInputChars)
{
// Prompt user for password input
CGUIDialogGamepad *pDialog = (CGUIDialogGamepad *)g_windowManager.GetWindow(WINDOW_DIALOG_GAMEPAD);
diff --git a/xbmc/dialogs/GUIDialogGamepad.h b/xbmc/dialogs/GUIDialogGamepad.h
index 888c72d733..27c17e81c7 100644
--- a/xbmc/dialogs/GUIDialogGamepad.h
+++ b/xbmc/dialogs/GUIDialogGamepad.h
@@ -30,15 +30,15 @@ public:
virtual ~CGUIDialogGamepad(void);
virtual bool OnMessage(CGUIMessage& message);
bool IsCanceled() const;
- CStdString m_strUserInput;
- CStdString m_strPassword;
+ std::string m_strUserInput;
+ std::string m_strPassword;
int m_iRetries;
bool m_bUserInputCleanup;
bool m_bHideInputChars;
- static bool ShowAndGetInput(CStdString& aTextString, const CStdString& dlgHeading, bool bHideUserInput);
- static bool ShowAndVerifyNewPassword(CStdString& strNewPassword);
- static int ShowAndVerifyPassword(CStdString& strPassword, const CStdString& dlgHeading, int iRetries);
- static bool ShowAndVerifyInput(CStdString& strPassword, const CStdString& dlgHeading, const CStdString& dlgLine0, const CStdString& dlgLine1, const CStdString& dlgLine2, bool bGetUserInput, bool bHideInputChars);
+ static bool ShowAndGetInput(std::string& aTextString, const std::string& dlgHeading, bool bHideUserInput);
+ static bool ShowAndVerifyNewPassword(std::string& strNewPassword);
+ static int ShowAndVerifyPassword(std::string& strPassword, const std::string& dlgHeading, int iRetries);
+ static bool ShowAndVerifyInput(std::string& strPassword, const std::string& dlgHeading, const std::string& dlgLine0, const std::string& dlgLine1, const std::string& dlgLine2, bool bGetUserInput, bool bHideInputChars);
protected:
virtual bool OnAction(const CAction &action);
bool m_bCanceled;
diff --git a/xbmc/dialogs/GUIDialogKaiToast.cpp b/xbmc/dialogs/GUIDialogKaiToast.cpp
index ddbab9d16a..97b0ccd473 100644
--- a/xbmc/dialogs/GUIDialogKaiToast.cpp
+++ b/xbmc/dialogs/GUIDialogKaiToast.cpp
@@ -75,22 +75,22 @@ void CGUIDialogKaiToast::OnWindowLoaded()
m_defaultIcon = msg.GetLabel();
}
-void CGUIDialogKaiToast::QueueNotification(eMessageType eType, const CStdString& aCaption, const CStdString& aDescription, unsigned int displayTime /*= TOAST_DISPLAY_TIME*/, bool withSound /*= true*/, unsigned int messageTime /*= TOAST_MESSAGE_TIME*/)
+void CGUIDialogKaiToast::QueueNotification(eMessageType eType, const std::string& aCaption, const std::string& aDescription, unsigned int displayTime /*= TOAST_DISPLAY_TIME*/, bool withSound /*= true*/, unsigned int messageTime /*= TOAST_MESSAGE_TIME*/)
{
AddToQueue("", eType, aCaption, aDescription, displayTime, withSound, messageTime);
}
-void CGUIDialogKaiToast::QueueNotification(const CStdString& aCaption, const CStdString& aDescription)
+void CGUIDialogKaiToast::QueueNotification(const std::string& aCaption, const std::string& aDescription)
{
QueueNotification("", aCaption, aDescription);
}
-void CGUIDialogKaiToast::QueueNotification(const CStdString& aImageFile, const CStdString& aCaption, const CStdString& aDescription, unsigned int displayTime /*= TOAST_DISPLAY_TIME*/, bool withSound /*= true*/, unsigned int messageTime /*= TOAST_MESSAGE_TIME*/)
+void CGUIDialogKaiToast::QueueNotification(const std::string& aImageFile, const std::string& aCaption, const std::string& aDescription, unsigned int displayTime /*= TOAST_DISPLAY_TIME*/, bool withSound /*= true*/, unsigned int messageTime /*= TOAST_MESSAGE_TIME*/)
{
AddToQueue(aImageFile, Default, aCaption, aDescription, displayTime, withSound, messageTime);
}
-void CGUIDialogKaiToast::AddToQueue(const CStdString& aImageFile, const eMessageType eType, const CStdString& aCaption, const CStdString& aDescription, unsigned int displayTime /*= TOAST_DISPLAY_TIME*/, bool withSound /*= true*/, unsigned int messageTime /*= TOAST_MESSAGE_TIME*/)
+void CGUIDialogKaiToast::AddToQueue(const std::string& aImageFile, const eMessageType eType, const std::string& aCaption, const std::string& aDescription, unsigned int displayTime /*= TOAST_DISPLAY_TIME*/, bool withSound /*= true*/, unsigned int messageTime /*= TOAST_MESSAGE_TIME*/)
{
CSingleLock lock(m_critical);
diff --git a/xbmc/dialogs/GUIDialogKaiToast.h b/xbmc/dialogs/GUIDialogKaiToast.h
index d0f36efc51..443083acc7 100644
--- a/xbmc/dialogs/GUIDialogKaiToast.h
+++ b/xbmc/dialogs/GUIDialogKaiToast.h
@@ -37,9 +37,9 @@ public:
struct Notification
{
- CStdString caption;
- CStdString description;
- CStdString imagefile;
+ std::string caption;
+ std::string description;
+ std::string imagefile;
eMessageType eType;
unsigned int displayTime;
unsigned int messageTime;
@@ -48,9 +48,9 @@ public:
typedef std::queue<Notification> TOASTQUEUE;
- static void QueueNotification(eMessageType eType, const CStdString& aCaption, const CStdString& aDescription, unsigned int displayTime = TOAST_DISPLAY_TIME, bool withSound = true, unsigned int messageTime = TOAST_MESSAGE_TIME);
- static void QueueNotification(const CStdString& aCaption, const CStdString& aDescription);
- static void QueueNotification(const CStdString& aImageFile, const CStdString& aCaption, const CStdString& aDescription, unsigned int displayTime = TOAST_DISPLAY_TIME, bool withSound = true, unsigned int messageTime = TOAST_MESSAGE_TIME);
+ static void QueueNotification(eMessageType eType, const std::string& aCaption, const std::string& aDescription, unsigned int displayTime = TOAST_DISPLAY_TIME, bool withSound = true, unsigned int messageTime = TOAST_MESSAGE_TIME);
+ static void QueueNotification(const std::string& aCaption, const std::string& aDescription);
+ static void QueueNotification(const std::string& aImageFile, const std::string& aCaption, const std::string& aDescription, unsigned int displayTime = TOAST_DISPLAY_TIME, bool withSound = true, unsigned int messageTime = TOAST_MESSAGE_TIME);
bool DoWork();
virtual bool OnMessage(CGUIMessage& message);
@@ -59,14 +59,14 @@ public:
void ResetTimer();
protected:
- static void AddToQueue(const CStdString& aImageFile, const eMessageType eType, const CStdString& aCaption, const CStdString& aDescription, unsigned int displayTime, bool withSound, unsigned int messageTime);
+ static void AddToQueue(const std::string& aImageFile, const eMessageType eType, const std::string& aCaption, const std::string& aDescription, unsigned int displayTime, bool withSound, unsigned int messageTime);
unsigned int m_timer;
unsigned int m_toastDisplayTime;
unsigned int m_toastMessageTime;
- CStdString m_defaultIcon;
+ std::string m_defaultIcon;
static TOASTQUEUE m_notifications;
static CCriticalSection m_critical;
diff --git a/xbmc/dialogs/GUIDialogKeyboardGeneric.cpp b/xbmc/dialogs/GUIDialogKeyboardGeneric.cpp
index 57e46ae7ad..f8cd48ddc8 100644
--- a/xbmc/dialogs/GUIDialogKeyboardGeneric.cpp
+++ b/xbmc/dialogs/GUIDialogKeyboardGeneric.cpp
@@ -309,7 +309,7 @@ bool CGUIDialogKeyboardGeneric::OnMessage(CGUIMessage& message)
return true;
}
-void CGUIDialogKeyboardGeneric::SetText(const CStdString& aTextString)
+void CGUIDialogKeyboardGeneric::SetText(const std::string& aTextString)
{
m_strEdit.clear();
m_strEditing.clear();
@@ -319,9 +319,9 @@ void CGUIDialogKeyboardGeneric::SetText(const CStdString& aTextString)
SetCursorPos(m_strEdit.size());
}
-void CGUIDialogKeyboardGeneric::InputText(const CStdString& aTextString)
+void CGUIDialogKeyboardGeneric::InputText(const std::string& aTextString)
{
- CStdStringW newStr;
+ std::wstring newStr;
g_charsetConverter.utf8ToW(aTextString, newStr);
if (!newStr.empty())
{
@@ -333,7 +333,7 @@ void CGUIDialogKeyboardGeneric::InputText(const CStdString& aTextString)
}
}
-void CGUIDialogKeyboardGeneric::InputTextEditing(const CStdString& aTextString, int start, int length)
+void CGUIDialogKeyboardGeneric::InputTextEditing(const std::string& aTextString, int start, int length)
{
m_strEditing.clear();
m_iEditingOffset = start;
@@ -344,9 +344,9 @@ void CGUIDialogKeyboardGeneric::InputTextEditing(const CStdString& aTextString,
SetCursorPos(GetCursorPos());
}
-CStdString CGUIDialogKeyboardGeneric::GetText() const
+std::string CGUIDialogKeyboardGeneric::GetText() const
{
- CStdString utf8String;
+ std::string utf8String;
g_charsetConverter.wToUTF8(m_strEdit, utf8String);
return utf8String;
}
@@ -379,7 +379,7 @@ void CGUIDialogKeyboardGeneric::UpdateLabel() // FIXME seems to be called twice
CGUILabelControl* pEdit = dynamic_cast<CGUILabelControl*>(GetControl(CTL_LABEL_EDIT));
if (pEdit)
{
- CStdStringW edit = m_strEdit;
+ std::wstring edit = m_strEdit;
pEdit->SetHighlight(0, 0);
pEdit->SetSelection(0, 0);
if (m_hiddenInput)
@@ -401,7 +401,7 @@ void CGUIDialogKeyboardGeneric::UpdateLabel() // FIXME seems to be called twice
pEdit->SetSelection(m_iCursorPos + m_iEditingOffset, m_iCursorPos + m_iEditingOffset + m_iEditingLength);
}
// convert back to utf8
- CStdString utf8Edit;
+ std::string utf8Edit;
g_charsetConverter.wToUTF8(edit, utf8Edit);
pEdit->SetLabel(utf8Edit);
// Send off a search message
@@ -533,7 +533,7 @@ void CGUIDialogKeyboardGeneric::UpdateButtons()
char szLabel[2];
szLabel[0] = 32;
szLabel[1] = 0;
- CStdString aLabel = szLabel;
+ std::string aLabel = szLabel;
// set numerals
for (int iButton = 48; iButton <= 57; iButton++)
@@ -628,9 +628,9 @@ void CGUIDialogKeyboardGeneric::OnIPAddress()
{
// find any IP address in the current string if there is any
// We match to #.#.#.#
- CStdString utf8String;
+ std::string utf8String;
g_charsetConverter.wToUTF8(m_strEdit, utf8String);
- CStdString ip;
+ std::string ip;
CRegExp reg;
reg.RegComp("[0-9]+\\.[0-9]+\\.[0-9]+\\.[0-9]+");
int start = reg.RegFind(utf8String.c_str());
@@ -662,7 +662,7 @@ void CGUIDialogKeyboardGeneric::ResetShiftAndSymbols()
const char* CGUIDialogKeyboardGeneric::s_charsSeries[10] = { " 0!@#$%^&*()[]{}<>/\\|", ".,1;:\'\"-+_=?`~", "ABC2", "DEF3", "GHI4", "JKL5", "MNO6", "PQRS7", "TUV8", "WXYZ9" };
-void CGUIDialogKeyboardGeneric::SetControlLabel(int id, const CStdString &label)
+void CGUIDialogKeyboardGeneric::SetControlLabel(int id, const std::string &label)
{ // find all controls with this id, and set all their labels
CGUIMessage message(GUI_MSG_LABEL_SET, GetID(), id);
message.SetLabel(label);
@@ -724,8 +724,8 @@ bool CGUIDialogKeyboardGeneric::ShowAndGetInput(char_callback_t pCallback, const
void CGUIDialogKeyboardGeneric::OnPasteClipboard(void)
{
- CStdStringW unicode_text;
- CStdStringA utf8_text;
+ std::wstring unicode_text;
+ std::string utf8_text;
// Get text from the clipboard
utf8_text = g_Windowing.GetClipboardText();
@@ -738,8 +738,8 @@ void CGUIDialogKeyboardGeneric::OnPasteClipboard(void)
size_t i = GetCursorPos();
if (i > m_strEdit.size())
i = m_strEdit.size();
- CStdStringW left_end = m_strEdit.substr(0, i);
- CStdStringW right_end = m_strEdit.substr(i);
+ std::wstring left_end = m_strEdit.substr(0, i);
+ std::wstring right_end = m_strEdit.substr(i);
m_strEdit = left_end;
m_strEdit.append(unicode_text);
diff --git a/xbmc/dialogs/GUIDialogKeyboardGeneric.h b/xbmc/dialogs/GUIDialogKeyboardGeneric.h
index 47df71fa05..f3236b9d7e 100644
--- a/xbmc/dialogs/GUIDialogKeyboardGeneric.h
+++ b/xbmc/dialogs/GUIDialogKeyboardGeneric.h
@@ -39,10 +39,10 @@ class CGUIDialogKeyboardGeneric : public CGUIDialog, public CGUIKeyboard
//CGUIDialog Interface
virtual void FrameMove();
void SetHeading(const std::string& heading);
- void SetText(const CStdString& aTextString);
- void InputText(const CStdString& aTextString);
- void InputTextEditing(const CStdString& aTextString, int start, int length);
- CStdString GetText() const;
+ void SetText(const std::string& aTextString);
+ void InputText(const std::string& aTextString);
+ void InputTextEditing(const std::string& aTextString, int start, int length);
+ std::string GetText() const;
bool IsConfirmed() { return m_bIsConfirmed; };
void SetHiddenInput(bool hiddenInput) { m_hiddenInput = hiddenInput; };
void Character(WCHAR wch);
@@ -53,7 +53,7 @@ class CGUIDialogKeyboardGeneric : public CGUIDialog, public CGUIKeyboard
virtual bool OnAction(const CAction &action);
virtual bool OnMessage(CGUIMessage& message);
virtual void OnDeinitWindow(int nextWindowID);
- void SetControlLabel(int id, const CStdString &label);
+ void SetControlLabel(int id, const std::string &label);
void OnShift();
void MoveCursor(int iAmount);
void SetCursorPos(int iPos);
@@ -72,11 +72,11 @@ class CGUIDialogKeyboardGeneric : public CGUIDialog, public CGUIKeyboard
void Backspace();
void SendSearchMessage();
- CStdStringW m_strEdit;
+ std::wstring m_strEdit;
int m_iCursorPos;
// holds the spelling region of keystrokes/text generated from 'input method'
- CStdStringW m_strEditing;
+ std::wstring m_strEditing;
int m_iEditingOffset;
int m_iEditingLength;
diff --git a/xbmc/dialogs/GUIDialogMediaFilter.cpp b/xbmc/dialogs/GUIDialogMediaFilter.cpp
index 329cf9bb8c..651e04d8ad 100644
--- a/xbmc/dialogs/GUIDialogMediaFilter.cpp
+++ b/xbmc/dialogs/GUIDialogMediaFilter.cpp
@@ -758,8 +758,8 @@ void CGUIDialogMediaFilter::GetRange(const Filter &filter, int &min, int &interv
if (m_mediaType == "movies" || m_mediaType == "tvshows" || m_mediaType == "musicvideos")
{
- CStdString table;
- CStdString year;
+ std::string table;
+ std::string year;
if (m_mediaType == "movies")
{
table = "movieview";
@@ -782,7 +782,7 @@ void CGUIDialogMediaFilter::GetRange(const Filter &filter, int &min, int &interv
}
else if (m_mediaType == "albums" || m_mediaType == "songs")
{
- CStdString table;
+ std::string table;
if (m_mediaType == "albums")
table = "albumview";
else if (m_mediaType == "songs")
@@ -803,7 +803,7 @@ void CGUIDialogMediaFilter::GetRange(const Filter &filter, int &min, int &interv
if (m_mediaType == "episodes")
{
- CStdString field = StringUtils::Format("CAST(strftime(\"%%s\", c%02d) AS INTEGER)", VIDEODB_ID_EPISODE_AIRED);
+ std::string field = StringUtils::Format("CAST(strftime(\"%%s\", c%02d) AS INTEGER)", VIDEODB_ID_EPISODE_AIRED);
GetMinMax("episodeview", field, min, max);
interval = 60 * 60 * 24 * 7; // 1 week
diff --git a/xbmc/dialogs/GUIDialogMediaSource.cpp b/xbmc/dialogs/GUIDialogMediaSource.cpp
index 428111033b..f7075af9ec 100644
--- a/xbmc/dialogs/GUIDialogMediaSource.cpp
+++ b/xbmc/dialogs/GUIDialogMediaSource.cpp
@@ -128,7 +128,7 @@ bool CGUIDialogMediaSource::OnMessage(CGUIMessage& message)
// \brief Show CGUIDialogMediaSource dialog and prompt for a new media source.
// \return True if the media source is added, false otherwise.
-bool CGUIDialogMediaSource::ShowAndAddMediaSource(const CStdString &type)
+bool CGUIDialogMediaSource::ShowAndAddMediaSource(const std::string &type)
{
CGUIDialogMediaSource *dialog = (CGUIDialogMediaSource *)g_windowManager.GetWindow(WINDOW_DIALOG_MEDIA_SOURCE);
if (!dialog) return false;
@@ -143,12 +143,12 @@ bool CGUIDialogMediaSource::ShowAndAddMediaSource(const CStdString &type)
unsigned int i,j=2;
bool bConfirmed=false;
VECSOURCES* pShares = CMediaSourceSettings::Get().GetSources(type);
- CStdString strName = dialog->m_name;
+ std::string strName = dialog->m_name;
while (!bConfirmed)
{
for (i=0;i<pShares->size();++i)
{
- if ((*pShares)[i].strName.Equals(strName))
+ if (StringUtils::EqualsNoCase((*pShares)[i].strName, strName))
break;
}
if (i < pShares->size()) // found a match - try next
@@ -166,23 +166,23 @@ bool CGUIDialogMediaSource::ShowAndAddMediaSource(const CStdString &type)
return confirmed;
}
-bool CGUIDialogMediaSource::ShowAndEditMediaSource(const CStdString &type, const CStdString&share)
+bool CGUIDialogMediaSource::ShowAndEditMediaSource(const std::string &type, const std::string&share)
{
VECSOURCES* pShares = CMediaSourceSettings::Get().GetSources(type);
if (pShares)
{
for (unsigned int i=0;i<pShares->size();++i)
{
- if ((*pShares)[i].strName.Equals(share))
+ if (StringUtils::EqualsNoCase((*pShares)[i].strName, share))
return ShowAndEditMediaSource(type,(*pShares)[i]);
}
}
return false;
}
-bool CGUIDialogMediaSource::ShowAndEditMediaSource(const CStdString &type, const CMediaSource &share)
+bool CGUIDialogMediaSource::ShowAndEditMediaSource(const std::string &type, const CMediaSource &share)
{
- CStdString strOldName = share.strName;
+ std::string strOldName = share.strName;
CGUIDialogMediaSource *dialog = (CGUIDialogMediaSource *)g_windowManager.GetWindow(WINDOW_DIALOG_MEDIA_SOURCE);
if (!dialog) return false;
dialog->Initialize();
@@ -195,12 +195,12 @@ bool CGUIDialogMediaSource::ShowAndEditMediaSource(const CStdString &type, const
unsigned int i,j=2;
bool bConfirmed=false;
VECSOURCES* pShares = CMediaSourceSettings::Get().GetSources(type);
- CStdString strName = dialog->m_name;
+ std::string strName = dialog->m_name;
while (!bConfirmed)
{
for (i=0;i<pShares->size();++i)
{
- if ((*pShares)[i].strName.Equals(strName))
+ if (StringUtils::EqualsNoCase((*pShares)[i].strName, strName))
break;
}
if (i < pShares->size() && (*pShares)[i].strName != strOldName) // found a match - try next
@@ -222,7 +222,7 @@ void CGUIDialogMediaSource::OnPathBrowse(int item)
if (item < 0 || item > m_paths->Size()) return;
// Browse is called. Open the filebrowser dialog.
// Ignore current path is best at this stage??
- CStdString path;
+ std::string path;
bool allowNetworkShares(m_type != "programs");
VECSOURCES extraShares;
@@ -360,7 +360,7 @@ void CGUIDialogMediaSource::OnPath(int item)
if (m_name != CUtil::GetTitleFromPath(m_paths->Get(item)->GetPath()))
m_bNameChanged=true;
- CStdString path(m_paths->Get(item)->GetPath());
+ std::string path(m_paths->Get(item)->GetPath());
CGUIKeyboardFactory::ShowAndGetInput(path, g_localizeStrings.Get(1021), false);
m_paths->Get(item)->SetPath(path);
@@ -425,7 +425,7 @@ void CGUIDialogMediaSource::UpdateButtons()
for (int i = 0; i < m_paths->Size(); i++)
{
CFileItemPtr item = m_paths->Get(i);
- CStdString path;
+ std::string path;
CURL url(item->GetPath());
path = url.GetWithoutUserDetails();
if (path.empty()) path = "<"+g_localizeStrings.Get(231)+">"; // <None>
@@ -455,7 +455,7 @@ void CGUIDialogMediaSource::SetShare(const CMediaSource &share)
UpdateButtons();
}
-void CGUIDialogMediaSource::SetTypeOfMedia(const CStdString &type, bool editNotAdd)
+void CGUIDialogMediaSource::SetTypeOfMedia(const std::string &type, bool editNotAdd)
{
m_type = type;
int typeStringID = -1;
@@ -469,7 +469,7 @@ void CGUIDialogMediaSource::SetTypeOfMedia(const CStdString &type, bool editNotA
typeStringID = 1213; // "Pictures"
else // if (type == "files");
typeStringID = 744; // "Files"
- CStdString format;
+ std::string format;
format = StringUtils::Format(g_localizeStrings.Get(editNotAdd ? 1028 : 1020).c_str(), g_localizeStrings.Get(typeStringID).c_str());
SET_CONTROL_LABEL(CONTROL_HEADING, format);
}
diff --git a/xbmc/dialogs/GUIDialogMediaSource.h b/xbmc/dialogs/GUIDialogMediaSource.h
index 54a4140912..66ec95a1ab 100644
--- a/xbmc/dialogs/GUIDialogMediaSource.h
+++ b/xbmc/dialogs/GUIDialogMediaSource.h
@@ -34,14 +34,14 @@ public:
virtual bool OnMessage(CGUIMessage& message);
virtual void OnDeinitWindow(int nextWindowID);
virtual bool OnBack(int actionID);
- static bool ShowAndAddMediaSource(const CStdString &type);
- static bool ShowAndEditMediaSource(const CStdString &type, const CMediaSource &share);
- static bool ShowAndEditMediaSource(const CStdString &type, const CStdString &share);
+ static bool ShowAndAddMediaSource(const std::string &type);
+ static bool ShowAndEditMediaSource(const std::string &type, const CMediaSource &share);
+ static bool ShowAndEditMediaSource(const std::string &type, const std::string &share);
bool IsConfirmed() const { return m_confirmed; };
void SetShare(const CMediaSource &share);
- void SetTypeOfMedia(const CStdString &type, bool editNotAdd = false);
+ void SetTypeOfMedia(const std::string &type, bool editNotAdd = false);
protected:
void OnPathBrowse(int item);
void OnPath(int item);
@@ -55,8 +55,8 @@ protected:
std::vector<std::string> GetPaths() const;
- CStdString m_type;
- CStdString m_name;
+ std::string m_type;
+ std::string m_name;
CFileItemList* m_paths;
bool m_confirmed;
bool m_bNameChanged;
diff --git a/xbmc/dialogs/GUIDialogNumeric.cpp b/xbmc/dialogs/GUIDialogNumeric.cpp
index f630692050..7610b8892e 100644
--- a/xbmc/dialogs/GUIDialogNumeric.cpp
+++ b/xbmc/dialogs/GUIDialogNumeric.cpp
@@ -300,7 +300,7 @@ void CGUIDialogNumeric::OnNext()
void CGUIDialogNumeric::FrameMove()
{
- CStdString strLabel;
+ std::string strLabel;
unsigned int start = 0;
unsigned int end = 0;
if (m_mode == INPUT_PASSWORD)
@@ -556,7 +556,7 @@ void CGUIDialogNumeric::SetMode(INPUT_MODE mode, void *initial)
m_lastblock = 3;
m_ip[0] = m_ip[1] = m_ip[2] = m_ip[3] = 0;
// copy ip string into numeric form
- CStdString ip = *(CStdString *)initial;
+ std::string ip = *(std::string *)initial;
unsigned int block = 0;
for (unsigned int i=0; i < ip.size(); i++)
{
@@ -574,10 +574,10 @@ void CGUIDialogNumeric::SetMode(INPUT_MODE mode, void *initial)
}
}
else if (m_mode == INPUT_NUMBER || m_mode == INPUT_PASSWORD)
- m_number = *(CStdString *)initial;
+ m_number = *(std::string *)initial;
}
-void CGUIDialogNumeric::SetMode(INPUT_MODE mode, const CStdString &initial)
+void CGUIDialogNumeric::SetMode(INPUT_MODE mode, const std::string &initial)
{
m_mode = mode;
m_block = 0;
@@ -595,7 +595,7 @@ void CGUIDialogNumeric::SetMode(INPUT_MODE mode, const CStdString &initial)
}
else
{
- CStdString tmp = initial;
+ std::string tmp = initial;
// if we are handling seconds and if the string only contains
// "mm:ss" we need to add dummy "hh:" to get "hh:mm:ss"
if (m_mode == INPUT_TIME_SECONDS && tmp.size() <= 5)
@@ -605,7 +605,7 @@ void CGUIDialogNumeric::SetMode(INPUT_MODE mode, const CStdString &initial)
}
else if (m_mode == INPUT_DATE)
{
- CStdString tmp = initial;
+ std::string tmp = initial;
StringUtils::Replace(tmp, '/', '.');
dateTime.SetFromDBDate(tmp);
}
@@ -626,14 +626,14 @@ void CGUIDialogNumeric::GetOutput(void *output) const
if (m_mode == INPUT_TIME || m_mode == INPUT_TIME_SECONDS || m_mode == INPUT_DATE)
memcpy(output, &m_datetime, sizeof(m_datetime));
else if (m_mode == INPUT_IP_ADDRESS)
- *(CStdString *)output = StringUtils::Format("%d.%d.%d.%d", m_ip[0], m_ip[1], m_ip[2], m_ip[3]);
+ *(std::string *)output = StringUtils::Format("%d.%d.%d.%d", m_ip[0], m_ip[1], m_ip[2], m_ip[3]);
else if (m_mode == INPUT_NUMBER || m_mode == INPUT_PASSWORD)
- *(CStdString *)output = m_number;
+ *(std::string *)output = m_number;
}
-CStdString CGUIDialogNumeric::GetOutput() const
+std::string CGUIDialogNumeric::GetOutput() const
{
- CStdString output;
+ std::string output;
if (m_mode == INPUT_DATE)
output = StringUtils::Format("%02i/%02i/%04i", m_datetime.wDay, m_datetime.wMonth, m_datetime.wYear);
else if (m_mode == INPUT_TIME)
@@ -645,7 +645,7 @@ CStdString CGUIDialogNumeric::GetOutput() const
return output;
}
-bool CGUIDialogNumeric::ShowAndGetSeconds(CStdString &timeString, const CStdString &heading)
+bool CGUIDialogNumeric::ShowAndGetSeconds(std::string &timeString, const std::string &heading)
{
CGUIDialogNumeric *pDialog = (CGUIDialogNumeric *)g_windowManager.GetWindow(WINDOW_DIALOG_NUMERIC);
if (!pDialog) return false;
@@ -665,7 +665,7 @@ bool CGUIDialogNumeric::ShowAndGetSeconds(CStdString &timeString, const CStdStri
return true;
}
-bool CGUIDialogNumeric::ShowAndGetTime(SYSTEMTIME &time, const CStdString &heading)
+bool CGUIDialogNumeric::ShowAndGetTime(SYSTEMTIME &time, const std::string &heading)
{
CGUIDialogNumeric *pDialog = (CGUIDialogNumeric *)g_windowManager.GetWindow(WINDOW_DIALOG_NUMERIC);
if (!pDialog) return false;
@@ -678,7 +678,7 @@ bool CGUIDialogNumeric::ShowAndGetTime(SYSTEMTIME &time, const CStdString &headi
return true;
}
-bool CGUIDialogNumeric::ShowAndGetDate(SYSTEMTIME &date, const CStdString &heading)
+bool CGUIDialogNumeric::ShowAndGetDate(SYSTEMTIME &date, const std::string &heading)
{
CGUIDialogNumeric *pDialog = (CGUIDialogNumeric *)g_windowManager.GetWindow(WINDOW_DIALOG_NUMERIC);
if (!pDialog) return false;
@@ -691,10 +691,10 @@ bool CGUIDialogNumeric::ShowAndGetDate(SYSTEMTIME &date, const CStdString &headi
return true;
}
-bool CGUIDialogNumeric::ShowAndGetIPAddress(CStdString &IPAddress, const CStdString &heading)
+bool CGUIDialogNumeric::ShowAndGetIPAddress(std::string &IPAddress, const std::string &heading)
{
CGUIDialogNumeric *pDialog = (CGUIDialogNumeric *)g_windowManager.GetWindow(WINDOW_DIALOG_NUMERIC);
- if (!pDialog || !IPAddress) return false;
+ if (!pDialog || IPAddress.empty()) return false;
pDialog->SetMode(INPUT_IP_ADDRESS, (void *)&IPAddress);
pDialog->SetHeading(heading);
pDialog->DoModal();
@@ -704,7 +704,7 @@ bool CGUIDialogNumeric::ShowAndGetIPAddress(CStdString &IPAddress, const CStdStr
return true;
}
-bool CGUIDialogNumeric::ShowAndGetNumber(CStdString& strInput, const CStdString &strHeading, unsigned int iAutoCloseTimeoutMs /* = 0 */)
+bool CGUIDialogNumeric::ShowAndGetNumber(std::string& strInput, const std::string &strHeading, unsigned int iAutoCloseTimeoutMs /* = 0 */)
{
// Prompt user for password input
CGUIDialogNumeric *pDialog = (CGUIDialogNumeric *)g_windowManager.GetWindow(WINDOW_DIALOG_NUMERIC);
@@ -725,10 +725,10 @@ bool CGUIDialogNumeric::ShowAndGetNumber(CStdString& strInput, const CStdString
// \brief Show numeric keypad twice to get and confirm a user-entered password string.
// \param strNewPassword String to preload into the keyboard accumulator. Overwritten with user input if return=true.
// \return true if successful display and user input entry/re-entry. false if unsuccessful display, no user input, or canceled editing.
-bool CGUIDialogNumeric::ShowAndVerifyNewPassword(CStdString& strNewPassword)
+bool CGUIDialogNumeric::ShowAndVerifyNewPassword(std::string& strNewPassword)
{
// Prompt user for password input
- CStdString strUserInput = "";
+ std::string strUserInput;
if (!ShowAndVerifyInput(strUserInput, g_localizeStrings.Get(12340), false))
{
// Show error to user saying the password entry was blank
@@ -758,16 +758,16 @@ bool CGUIDialogNumeric::ShowAndVerifyNewPassword(CStdString& strNewPassword)
// \param strHeading String shown on dialog title. Converts to localized string if contains a positive integer.
// \param iRetries If greater than 0, shows "Incorrect password, %d retries left" on dialog line 2, else line 2 is blank.
// \return 0 if successful display and user input. 1 if unsuccessful input. -1 if no user input or canceled editing.
-int CGUIDialogNumeric::ShowAndVerifyPassword(CStdString& strPassword, const CStdString& strHeading, int iRetries)
+int CGUIDialogNumeric::ShowAndVerifyPassword(std::string& strPassword, const std::string& strHeading, int iRetries)
{
- CStdString strTempHeading = strHeading;
+ std::string strTempHeading = strHeading;
if (0 < iRetries)
{
// Show a string telling user they have iRetries retries left
strTempHeading = StringUtils::Format("%s. %s %i %s", strHeading.c_str(), g_localizeStrings.Get(12342).c_str(), iRetries, g_localizeStrings.Get(12343).c_str());
}
// make a copy of strPassword to prevent from overwriting it later
- CStdString strPassTemp = strPassword;
+ std::string strPassTemp = strPassword;
if (ShowAndVerifyInput(strPassTemp, strTempHeading, true))
return 0; // user entered correct password
if (strPassTemp.empty()) return -1; // user canceled out
@@ -779,13 +779,13 @@ int CGUIDialogNumeric::ShowAndVerifyPassword(CStdString& strPassword, const CStd
// \param dlgHeading String shown on dialog title.
// \param bVerifyInput If set as true we verify the users input versus strToVerify.
// \return true if successful display and user input. false if unsuccessful display, no user input, or canceled editing.
-bool CGUIDialogNumeric::ShowAndVerifyInput(CStdString& strToVerify, const CStdString& dlgHeading, bool bVerifyInput)
+bool CGUIDialogNumeric::ShowAndVerifyInput(std::string& strToVerify, const std::string& dlgHeading, bool bVerifyInput)
{
// Prompt user for password input
CGUIDialogNumeric *pDialog = (CGUIDialogNumeric *)g_windowManager.GetWindow(WINDOW_DIALOG_NUMERIC);
pDialog->SetHeading( dlgHeading );
- CStdString strInput = "";
+ std::string strInput;
if (!bVerifyInput)
strInput = strToVerify;
pDialog->SetMode(INPUT_PASSWORD, (void *)&strInput);
@@ -800,7 +800,7 @@ bool CGUIDialogNumeric::ShowAndVerifyInput(CStdString& strToVerify, const CStdSt
return false;
}
- CStdString md5pword2 = XBMC::XBMC_MD5::GetMD5(strInput);
+ std::string md5pword2 = XBMC::XBMC_MD5::GetMD5(strInput);
if (!bVerifyInput)
{
@@ -809,7 +809,7 @@ bool CGUIDialogNumeric::ShowAndVerifyInput(CStdString& strToVerify, const CStdSt
return true;
}
- if (strToVerify.Equals(md5pword2))
+ if (StringUtils::EqualsNoCase(strToVerify, md5pword2))
return true; // entered correct password
// incorrect password
@@ -826,7 +826,7 @@ bool CGUIDialogNumeric::IsCanceled() const
return m_bCanceled;
}
-void CGUIDialogNumeric::SetHeading(const CStdString& strHeading)
+void CGUIDialogNumeric::SetHeading(const std::string& strHeading)
{
Initialize();
CGUIMessage msg(GUI_MSG_LABEL_SET, GetID(), CONTROL_HEADING_LABEL);
diff --git a/xbmc/dialogs/GUIDialogNumeric.h b/xbmc/dialogs/GUIDialogNumeric.h
index c1870eb136..00da800ee1 100644
--- a/xbmc/dialogs/GUIDialogNumeric.h
+++ b/xbmc/dialogs/GUIDialogNumeric.h
@@ -37,21 +37,21 @@ public:
bool IsConfirmed() const;
bool IsCanceled() const;
- static bool ShowAndVerifyNewPassword(CStdString& strNewPassword);
- static int ShowAndVerifyPassword(CStdString& strPassword, const CStdString& strHeading, int iRetries);
- static bool ShowAndVerifyInput(CStdString& strPassword, const CStdString& strHeading, bool bGetUserInput);
+ static bool ShowAndVerifyNewPassword(std::string& strNewPassword);
+ static int ShowAndVerifyPassword(std::string& strPassword, const std::string& strHeading, int iRetries);
+ static bool ShowAndVerifyInput(std::string& strPassword, const std::string& strHeading, bool bGetUserInput);
- void SetHeading(const CStdString &strHeading);
+ void SetHeading(const std::string &strHeading);
void SetMode(INPUT_MODE mode, void *initial);
- void SetMode(INPUT_MODE mode, const CStdString &initial);
+ void SetMode(INPUT_MODE mode, const std::string &initial);
void GetOutput(void *output) const;
- CStdString GetOutput() const;
+ std::string GetOutput() const;
- static bool ShowAndGetTime(SYSTEMTIME &time, const CStdString &heading);
- static bool ShowAndGetDate(SYSTEMTIME &date, const CStdString &heading);
- static bool ShowAndGetIPAddress(CStdString &IPAddress, const CStdString &heading);
- static bool ShowAndGetNumber(CStdString& strInput, const CStdString &strHeading, unsigned int iAutoCloseTimeoutMs = 0);
- static bool ShowAndGetSeconds(CStdString& timeString, const CStdString &heading);
+ static bool ShowAndGetTime(SYSTEMTIME &time, const std::string &heading);
+ static bool ShowAndGetDate(SYSTEMTIME &date, const std::string &heading);
+ static bool ShowAndGetIPAddress(std::string &IPAddress, const std::string &heading);
+ static bool ShowAndGetNumber(std::string& strInput, const std::string &strHeading, unsigned int iAutoCloseTimeoutMs = 0);
+ static bool ShowAndGetSeconds(std::string& timeString, const std::string &heading);
protected:
virtual void OnInitWindow();
@@ -74,5 +74,5 @@ protected:
unsigned int m_block; // for time, date, and IP methods.
unsigned int m_lastblock;
bool m_dirty; // true if the current block has been changed.
- CStdString m_number; ///< for number or password input
+ std::string m_number; ///< for number or password input
};
diff --git a/xbmc/dialogs/GUIDialogPlayEject.cpp b/xbmc/dialogs/GUIDialogPlayEject.cpp
index a7e49d157c..51dffec094 100644
--- a/xbmc/dialogs/GUIDialogPlayEject.cpp
+++ b/xbmc/dialogs/GUIDialogPlayEject.cpp
@@ -100,7 +100,7 @@ bool CGUIDialogPlayEject::ShowAndGetInput(const CFileItem & item,
return false;
// Figure out Lines 1 and 2 of the dialog
- CStdString strLine1, strLine2;
+ std::string strLine1, strLine2;
CXBMCTinyXML discStubXML;
if (discStubXML.LoadFile(item.GetPath()))
{
diff --git a/xbmc/dialogs/GUIDialogSelect.cpp b/xbmc/dialogs/GUIDialogSelect.cpp
index 1447c76d1a..a31660ebe0 100644
--- a/xbmc/dialogs/GUIDialogSelect.cpp
+++ b/xbmc/dialogs/GUIDialogSelect.cpp
@@ -170,7 +170,7 @@ void CGUIDialogSelect::Reset()
m_selectedItems->Clear();
}
-int CGUIDialogSelect::Add(const CStdString& strLabel)
+int CGUIDialogSelect::Add(const std::string& strLabel)
{
CFileItemPtr pItem(new CFileItem(strLabel));
m_vecList->Add(pItem);
@@ -256,7 +256,7 @@ void CGUIDialogSelect::SetSelected(int iSelected)
m_selectedItems->Add(m_vecList->Get(iSelected));
}
-void CGUIDialogSelect::SetSelected(const CStdString &strSelectedLabel)
+void CGUIDialogSelect::SetSelected(const std::string &strSelectedLabel)
{
if (strSelectedLabel.empty())
return;
@@ -332,7 +332,7 @@ void CGUIDialogSelect::OnInitWindow()
}
m_viewControl.SetCurrentView(m_useDetails ? CONTROL_DETAILS : CONTROL_LIST);
- CStdString items = StringUtils::Format("%i %s", m_vecList->Size(), g_localizeStrings.Get(127).c_str());
+ std::string items = StringUtils::Format("%i %s", m_vecList->Size(), g_localizeStrings.Get(127).c_str());
SET_CONTROL_LABEL(CONTROL_NUMBEROFFILES, items);
if (m_multiSelection)
diff --git a/xbmc/dialogs/GUIDialogSelect.h b/xbmc/dialogs/GUIDialogSelect.h
index 9fd7a4a579..3b2dd6fe11 100644
--- a/xbmc/dialogs/GUIDialogSelect.h
+++ b/xbmc/dialogs/GUIDialogSelect.h
@@ -37,7 +37,7 @@ public:
virtual bool OnBack(int actionID);
void Reset();
- int Add(const CStdString& strLabel);
+ int Add(const std::string& strLabel);
int Add(const CFileItem* pItem);
void Add(const CFileItemList& items);
void SetItems(CFileItemList* items);
@@ -49,7 +49,7 @@ public:
bool IsButtonPressed();
void Sort(bool bSortOrder = true);
void SetSelected(int iSelected);
- void SetSelected(const CStdString &strSelectedLabel);
+ void SetSelected(const std::string &strSelectedLabel);
void SetSelected(std::vector<int> selectedIndexes);
void SetSelected(const std::vector<std::string> &selectedLabels);
void SetUseDetails(bool useDetails);
diff --git a/xbmc/dialogs/GUIDialogSlider.cpp b/xbmc/dialogs/GUIDialogSlider.cpp
index 168c213263..15d8cadfa7 100644
--- a/xbmc/dialogs/GUIDialogSlider.cpp
+++ b/xbmc/dialogs/GUIDialogSlider.cpp
@@ -73,7 +73,7 @@ bool CGUIDialogSlider::OnMessage(CGUIMessage& message)
return CGUIDialog::OnMessage(message);
}
-void CGUIDialogSlider::SetSlider(const CStdString &label, float value, float min, float delta, float max, ISliderCallback *callback, void *callbackData)
+void CGUIDialogSlider::SetSlider(const std::string &label, float value, float min, float delta, float max, ISliderCallback *callback, void *callbackData)
{
SET_CONTROL_LABEL(CONTROL_HEADING, label);
CGUISliderControl *slider = dynamic_cast<CGUISliderControl *>(GetControl(CONTROL_SLIDER));
@@ -101,7 +101,7 @@ void CGUIDialogSlider::OnWindowLoaded()
CGUIDialog::OnWindowLoaded();
}
-void CGUIDialogSlider::ShowAndGetInput(const CStdString &label, float value, float min, float delta, float max, ISliderCallback *callback, void *callbackData)
+void CGUIDialogSlider::ShowAndGetInput(const std::string &label, float value, float min, float delta, float max, ISliderCallback *callback, void *callbackData)
{
// grab the slider dialog
CGUIDialogSlider *slider = (CGUIDialogSlider *)g_windowManager.GetWindow(WINDOW_DIALOG_SLIDER);
diff --git a/xbmc/dialogs/GUIDialogSlider.h b/xbmc/dialogs/GUIDialogSlider.h
index b5cee2fb7e..c1ac8d0dc9 100644
--- a/xbmc/dialogs/GUIDialogSlider.h
+++ b/xbmc/dialogs/GUIDialogSlider.h
@@ -43,7 +43,7 @@ public:
\param callbackData pointer to callback-specific data (defaults to NULL)
\sa ISliderCallback, Display
*/
- static void ShowAndGetInput(const CStdString &label, float value, float min, float delta, float max, ISliderCallback *callback, void *callbackData = NULL);
+ static void ShowAndGetInput(const std::string &label, float value, float min, float delta, float max, ISliderCallback *callback, void *callbackData = NULL);
/*! \brief Show the slider dialog as a response to user input
Shows the slider with the given values for a short period of time, used for UI feedback of a set user action.
@@ -58,7 +58,7 @@ public:
*/
static void Display(int label, float value, float min, float delta, float max, ISliderCallback *callback);
protected:
- void SetSlider(const CStdString &label, float value, float min, float delta, float max, ISliderCallback *callback, void *callbackData);
+ void SetSlider(const std::string &label, float value, float min, float delta, float max, ISliderCallback *callback, void *callbackData);
virtual void OnWindowLoaded();
ISliderCallback *m_callback;
diff --git a/xbmc/dialogs/GUIDialogSmartPlaylistEditor.cpp b/xbmc/dialogs/GUIDialogSmartPlaylistEditor.cpp
index a3d46ad92c..2fc4e41a83 100644
--- a/xbmc/dialogs/GUIDialogSmartPlaylistEditor.cpp
+++ b/xbmc/dialogs/GUIDialogSmartPlaylistEditor.cpp
@@ -164,8 +164,8 @@ void CGUIDialogSmartPlaylistEditor::OnOK()
// save our playlist
if (m_path.empty())
{
- CStdString filename(CUtil::MakeLegalFileName(m_playlist.m_playlistName));
- CStdString path;
+ std::string filename(CUtil::MakeLegalFileName(m_playlist.m_playlistName));
+ std::string path;
if (CGUIKeyboardFactory::ShowAndGetInput(filename, g_localizeStrings.Get(16013), false))
{
path = URIUtils::AddFileToFolder(systemPlaylistsPath, m_playlist.GetSaveLocation());
@@ -185,8 +185,8 @@ void CGUIDialogSmartPlaylistEditor::OnOK()
// this occurs if the user switches from music video <> songs <> mixed
if (StringUtils::StartsWith(m_path, systemPlaylistsPath))
{
- CStdString filename = URIUtils::GetFileName(m_path);
- CStdString strFolder = m_path.substr(systemPlaylistsPath.size(), m_path.size() - filename.size() - systemPlaylistsPath.size() - 1);
+ std::string filename = URIUtils::GetFileName(m_path);
+ std::string strFolder = m_path.substr(systemPlaylistsPath.size(), m_path.size() - filename.size() - systemPlaylistsPath.size() - 1);
if (strFolder != m_playlist.GetSaveLocation())
{ // move to the correct folder
XFILE::CFile::Delete(m_path);
@@ -387,24 +387,24 @@ void CGUIDialogSmartPlaylistEditor::OnInitWindow()
SendMessage(GUI_MSG_ITEM_SELECT, CONTROL_LIMIT, m_playlist.m_limit);
vector<PLAYLIST_TYPE> allowedTypes;
- if (m_mode.Equals("partymusic"))
+ if (m_mode == "partymusic")
{
allowedTypes.push_back(TYPE_SONGS);
allowedTypes.push_back(TYPE_MIXED);
}
- else if (m_mode.Equals("partyvideo"))
+ else if (m_mode == "partyvideo")
{
allowedTypes.push_back(TYPE_MUSICVIDEOS);
allowedTypes.push_back(TYPE_MIXED);
}
- else if (m_mode.Equals("music"))
+ else if (m_mode == "music")
{ // music types + mixed
allowedTypes.push_back(TYPE_SONGS);
allowedTypes.push_back(TYPE_ALBUMS);
allowedTypes.push_back(TYPE_ARTISTS);
allowedTypes.push_back(TYPE_MIXED);
}
- else if (m_mode.Equals("video"))
+ else if (m_mode == "video")
{ // general category for videos
allowedTypes.push_back(TYPE_MOVIES);
allowedTypes.push_back(TYPE_TVSHOWS);
@@ -440,10 +440,10 @@ void CGUIDialogSmartPlaylistEditor::OnDeinitWindow(int nextWindowID)
m_ruleLabels->Clear();
}
-CGUIDialogSmartPlaylistEditor::PLAYLIST_TYPE CGUIDialogSmartPlaylistEditor::ConvertType(const CStdString &type)
+CGUIDialogSmartPlaylistEditor::PLAYLIST_TYPE CGUIDialogSmartPlaylistEditor::ConvertType(const std::string &type)
{
for (unsigned int i = 0; i < NUM_TYPES; i++)
- if (type.Equals(types[i].string))
+ if (type == types[i].string)
return types[i].type;
assert(false);
return TYPE_SONGS;
@@ -458,7 +458,7 @@ std::string CGUIDialogSmartPlaylistEditor::GetLocalizedType(PLAYLIST_TYPE type)
return "";
}
-CStdString CGUIDialogSmartPlaylistEditor::ConvertType(PLAYLIST_TYPE type)
+std::string CGUIDialogSmartPlaylistEditor::ConvertType(PLAYLIST_TYPE type)
{
for (unsigned int i = 0; i < NUM_TYPES; i++)
if (types[i].type == type)
@@ -513,7 +513,7 @@ void CGUIDialogSmartPlaylistEditor::OnRuleAdd()
UpdateButtons();
}
-bool CGUIDialogSmartPlaylistEditor::NewPlaylist(const CStdString &type)
+bool CGUIDialogSmartPlaylistEditor::NewPlaylist(const std::string &type)
{
CGUIDialogSmartPlaylistEditor *editor = (CGUIDialogSmartPlaylistEditor *)g_windowManager.GetWindow(WINDOW_DIALOG_SMART_PLAYLIST_EDITOR);
if (!editor) return false;
@@ -526,15 +526,15 @@ bool CGUIDialogSmartPlaylistEditor::NewPlaylist(const CStdString &type)
return !editor->m_cancelled;
}
-bool CGUIDialogSmartPlaylistEditor::EditPlaylist(const CStdString &path, const CStdString &type)
+bool CGUIDialogSmartPlaylistEditor::EditPlaylist(const std::string &path, const std::string &type)
{
CGUIDialogSmartPlaylistEditor *editor = (CGUIDialogSmartPlaylistEditor *)g_windowManager.GetWindow(WINDOW_DIALOG_SMART_PLAYLIST_EDITOR);
if (!editor) return false;
editor->m_mode = type;
- if (path.Equals(CProfilesManager::Get().GetUserDataItem("PartyMode.xsp").c_str()))
+ if (URIUtils::PathEquals(path, CProfilesManager::Get().GetUserDataItem("PartyMode.xsp")))
editor->m_mode = "partymusic";
- if (path.Equals(CProfilesManager::Get().GetUserDataItem("PartyMode-Video.xsp").c_str()))
+ if (URIUtils::PathEquals(path, CProfilesManager::Get().GetUserDataItem("PartyMode-Video.xsp")))
editor->m_mode = "partyvideo";
CSmartPlaylist playlist;
diff --git a/xbmc/dialogs/GUIDialogSmartPlaylistEditor.h b/xbmc/dialogs/GUIDialogSmartPlaylistEditor.h
index 7c948b76e8..861ef69977 100644
--- a/xbmc/dialogs/GUIDialogSmartPlaylistEditor.h
+++ b/xbmc/dialogs/GUIDialogSmartPlaylistEditor.h
@@ -39,8 +39,8 @@ public:
virtual void OnInitWindow();
virtual void OnDeinitWindow(int nextWindowID);
- static bool EditPlaylist(const CStdString &path, const CStdString &type = "");
- static bool NewPlaylist(const CStdString &type);
+ static bool EditPlaylist(const std::string &path, const std::string &type = "");
+ static bool NewPlaylist(const std::string &type);
protected:
void OnRuleList(int item);
@@ -59,8 +59,8 @@ protected:
void UpdateRuleControlButtons();
int GetSelectedItem();
void HighlightItem(int item);
- PLAYLIST_TYPE ConvertType(const CStdString &type);
- CStdString ConvertType(PLAYLIST_TYPE type);
+ PLAYLIST_TYPE ConvertType(const std::string &type);
+ std::string ConvertType(PLAYLIST_TYPE type);
std::string GetLocalizedType(PLAYLIST_TYPE type);
CSmartPlaylist m_playlist;
@@ -68,7 +68,7 @@ protected:
// our list of rules for display purposes
CFileItemList* m_ruleLabels;
- CStdString m_path;
+ std::string m_path;
bool m_cancelled;
- CStdString m_mode; // mode we're in (partymode etc.)
+ std::string m_mode; // mode we're in (partymode etc.)
};
diff --git a/xbmc/dialogs/GUIDialogSmartPlaylistRule.cpp b/xbmc/dialogs/GUIDialogSmartPlaylistRule.cpp
index f3a8234fb4..0130f2b5de 100644
--- a/xbmc/dialogs/GUIDialogSmartPlaylistRule.cpp
+++ b/xbmc/dialogs/GUIDialogSmartPlaylistRule.cpp
@@ -72,7 +72,7 @@ bool CGUIDialogSmartPlaylistRule::OnMessage(CGUIMessage& message)
OnCancel();
else if (iControl == CONTROL_VALUE)
{
- CStdString parameter;
+ std::string parameter;
OnEditChanged(iControl, parameter);
m_rule.SetParameter(parameter);
}
@@ -114,19 +114,19 @@ void CGUIDialogSmartPlaylistRule::OnBrowse()
basePath = "videodb://";
VIDEODB_CONTENT_TYPE type = VIDEODB_CONTENT_MOVIES;
- if (m_type.Equals("movies"))
+ if (m_type == "movies")
basePath += "movies/";
- else if (m_type.Equals("tvshows"))
+ else if (m_type == "tvshows")
{
type = VIDEODB_CONTENT_TVSHOWS;
basePath += "tvshows/";
}
- else if (m_type.Equals("musicvideos"))
+ else if (m_type == "musicvideos")
{
type = VIDEODB_CONTENT_MUSICVIDEOS;
basePath += "musicvideos/";
}
- else if (m_type.Equals("episodes"))
+ else if (m_type == "episodes")
{
if (m_rule.m_field == FieldGenre || m_rule.m_field == FieldYear ||
m_rule.m_field == FieldStudio)
@@ -139,11 +139,17 @@ void CGUIDialogSmartPlaylistRule::OnBrowse()
int iLabel = 0;
if (m_rule.m_field == FieldGenre)
{
- if (m_type.Equals("tvshows") || m_type.Equals("episodes") || m_type.Equals("movies"))
+ if (m_type == "tvshows" ||
+ m_type == "episodes" ||
+ m_type == "movies")
videodatabase.GetGenresNav(basePath + "genres/", items, type);
- else if (m_type.Equals("songs") || m_type.Equals("albums") || m_type.Equals("artists") || m_type.Equals("mixed"))
+ else if (m_type == "songs" ||
+ m_type == "albums" ||
+ m_type == "artists" ||
+ m_type == "mixed")
database.GetGenresNav("musicdb://genres/",items);
- if (m_type.Equals("musicvideos") || m_type.Equals("mixed"))
+ if (m_type == "musicvideos" ||
+ m_type == "mixed")
{
CFileItemList items2;
videodatabase.GetGenresNav("videodb://musicvideos/genres/",items2,VIDEODB_CONTENT_MUSICVIDEOS);
@@ -160,7 +166,8 @@ void CGUIDialogSmartPlaylistRule::OnBrowse()
{
if (CSmartPlaylist::IsMusicType(m_type))
database.GetArtistsNav("musicdb://artists/", items, m_rule.m_field == FieldAlbumArtist, -1);
- if (m_type.Equals("musicvideos") || m_type.Equals("mixed"))
+ if (m_type == "musicvideos" ||
+ m_type == "mixed")
{
CFileItemList items2;
videodatabase.GetMusicVideoArtistsByName("", items2);
@@ -172,7 +179,8 @@ void CGUIDialogSmartPlaylistRule::OnBrowse()
{
if (CSmartPlaylist::IsMusicType(m_type))
database.GetAlbumsNav("musicdb://albums/", items);
- if (m_type.Equals("musicvideos") || m_type.Equals("mixed"))
+ if (m_type == "musicvideos" ||
+ m_type == "mixed")
{
CFileItemList items2;
videodatabase.GetMusicVideoAlbumsByName("", items2);
@@ -189,7 +197,9 @@ void CGUIDialogSmartPlaylistRule::OnBrowse()
{
if (CSmartPlaylist::IsMusicType(m_type))
database.GetYearsNav("musicdb://years/", items);
- if (!m_type.Equals("songs") && !m_type.Equals("albums") && !m_type.Equals("artists"))
+ if (m_type != "songs" &&
+ m_type != "albums" &&
+ m_type != "artists")
{
CFileItemList items2;
videodatabase.GetYearsNav(basePath + "years/", items2, type);
@@ -213,24 +223,24 @@ void CGUIDialogSmartPlaylistRule::OnBrowse()
iLabel = 20417;
}
else if (m_rule.m_field == FieldTvShowTitle ||
- (m_type.Equals("tvshows") && m_rule.m_field == FieldTitle))
+ (m_type == "tvshows" && m_rule.m_field == FieldTitle))
{
videodatabase.GetTvShowsNav(basePath + "titles/", items);
iLabel = 20343;
}
else if (m_rule.m_field == FieldTitle)
{
- if (m_type.Equals("songs"))
+ if (m_type == "songs")
{
database.GetSongsNav("musicdb://songs/", items, -1, -1, -1);
iLabel = 134;
}
- else if (m_type.Equals("movies"))
+ else if (m_type == "movies")
{
videodatabase.GetMoviesNav(basePath + "titles/", items);
iLabel = 20342;
}
- else if (m_type.Equals("episodes"))
+ else if (m_type == "episodes")
{
videodatabase.GetEpisodesNav(basePath + "titles/-1/-1/", items);
// we need to replace the db label (<season>x<episode> <title>) with the title only
@@ -239,7 +249,7 @@ void CGUIDialogSmartPlaylistRule::OnBrowse()
format.FormatLabel(items[i].get());
iLabel = 20360;
}
- else if (m_type.Equals("musicvideos"))
+ else if (m_type == "musicvideos")
{
videodatabase.GetMusicVideosNav(basePath + "titles/", items);
iLabel = 20389;
@@ -254,8 +264,10 @@ void CGUIDialogSmartPlaylistRule::OnBrowse()
// Note: This can cause infinite loops (playlist that refers to the same playlist) but I don't
// think there's any decent way to deal with this, as the infinite loop may be an arbitrary
// number of playlists deep, eg playlist1 -> playlist2 -> playlist3 ... -> playlistn -> playlist1
- CStdString path = "special://videoplaylists/";
- if (m_type.Equals("songs") || m_type.Equals("albums") || m_type.Equals("artists"))
+ std::string path = "special://videoplaylists/";
+ if (m_type == "songs" ||
+ m_type == "albums" ||
+ m_type == "artists")
path = "special://musicplaylists/";
XFILE::CDirectory::GetDirectory(path, items, ".xsp", XFILE::DIR_FLAG_NO_FILE_DIRS);
for (int i = 0; i < items.Size(); i++)
@@ -291,7 +303,7 @@ void CGUIDialogSmartPlaylistRule::OnBrowse()
}
g_mediaManager.GetLocalDrives(sources);
- CStdString path = m_rule.GetParameter();
+ std::string path = m_rule.GetParameter();
CGUIDialogFileBrowser::ShowAndGetDirectory(sources, g_localizeStrings.Get(657), path, false);
if (m_rule.m_parameter.size() > 0)
m_rule.m_parameter.clear();
@@ -330,7 +342,7 @@ void CGUIDialogSmartPlaylistRule::OnBrowse()
CGUIDialogSelect* pDialog = (CGUIDialogSelect*)g_windowManager.GetWindow(WINDOW_DIALOG_SELECT);
pDialog->Reset();
pDialog->SetItems(&items);
- CStdString strHeading = StringUtils::Format(g_localizeStrings.Get(13401).c_str(), g_localizeStrings.Get(iLabel).c_str());
+ std::string strHeading = StringUtils::Format(g_localizeStrings.Get(13401).c_str(), g_localizeStrings.Get(iLabel).c_str());
pDialog->SetHeading(strHeading);
pDialog->SetMultiSelection(m_rule.m_field != FieldPlaylist && m_rule.m_field != FieldVirtualFolder);
@@ -509,7 +521,7 @@ void CGUIDialogSmartPlaylistRule::OnDeinitWindow(int nextWindowID)
SendMessage(GUI_MSG_LABEL_RESET, CONTROL_OPERATOR);
}
-bool CGUIDialogSmartPlaylistRule::EditRule(CSmartPlaylistRule &rule, const CStdString& type)
+bool CGUIDialogSmartPlaylistRule::EditRule(CSmartPlaylistRule &rule, const std::string& type)
{
CGUIDialogSmartPlaylistRule *editor = (CGUIDialogSmartPlaylistRule *)g_windowManager.GetWindow(WINDOW_DIALOG_SMART_PLAYLIST_RULE);
if (!editor) return false;
diff --git a/xbmc/dialogs/GUIDialogSmartPlaylistRule.h b/xbmc/dialogs/GUIDialogSmartPlaylistRule.h
index 31dee2ac95..b3b935623d 100644
--- a/xbmc/dialogs/GUIDialogSmartPlaylistRule.h
+++ b/xbmc/dialogs/GUIDialogSmartPlaylistRule.h
@@ -34,7 +34,7 @@ public:
virtual void OnInitWindow();
virtual void OnDeinitWindow(int nextWindowID);
- static bool EditRule(CSmartPlaylistRule &rule, const CStdString& type="songs");
+ static bool EditRule(CSmartPlaylistRule &rule, const std::string& type="songs");
protected:
void OnField();
@@ -46,5 +46,5 @@ protected:
CSmartPlaylistRule m_rule;
bool m_cancelled;
- CStdString m_type;
+ std::string m_type;
};
diff --git a/xbmc/dialogs/GUIDialogSubMenu.cpp b/xbmc/dialogs/GUIDialogSubMenu.cpp
index 70030524ed..8b143c6d30 100644
--- a/xbmc/dialogs/GUIDialogSubMenu.cpp
+++ b/xbmc/dialogs/GUIDialogSubMenu.cpp
@@ -20,8 +20,8 @@
#include "GUIDialogSubMenu.h"
-CGUIDialogSubMenu::CGUIDialogSubMenu(int id, const CStdString &xmlFile)
- : CGUIDialog(id, xmlFile)
+CGUIDialogSubMenu::CGUIDialogSubMenu(int id, const std::string &xmlFile)
+ : CGUIDialog(id, xmlFile.c_str())
{
}
diff --git a/xbmc/dialogs/GUIDialogSubMenu.h b/xbmc/dialogs/GUIDialogSubMenu.h
index eaf1acca42..e8965027f0 100644
--- a/xbmc/dialogs/GUIDialogSubMenu.h
+++ b/xbmc/dialogs/GUIDialogSubMenu.h
@@ -26,7 +26,7 @@ class CGUIDialogSubMenu :
public CGUIDialog
{
public:
- CGUIDialogSubMenu(int id = WINDOW_DIALOG_SUB_MENU, const CStdString &xmlFile = "DialogSubMenu.xml");
+ CGUIDialogSubMenu(int id = WINDOW_DIALOG_SUB_MENU, const std::string &xmlFile = "DialogSubMenu.xml");
virtual ~CGUIDialogSubMenu(void);
virtual bool OnMessage(CGUIMessage &message);
};
diff --git a/xbmc/dialogs/GUIDialogTextViewer.h b/xbmc/dialogs/GUIDialogTextViewer.h
index 60def1d238..6fbd19097b 100644
--- a/xbmc/dialogs/GUIDialogTextViewer.h
+++ b/xbmc/dialogs/GUIDialogTextViewer.h
@@ -30,13 +30,13 @@ public:
virtual ~CGUIDialogTextViewer(void);
virtual bool OnMessage(CGUIMessage& message);
virtual bool OnAction(const CAction &action);
- void SetText(const CStdString& strText) { m_strText = strText; }
- void SetHeading(const CStdString& strHeading) { m_strHeading = strHeading; }
+ void SetText(const std::string& strText) { m_strText = strText; }
+ void SetHeading(const std::string& strHeading) { m_strHeading = strHeading; }
protected:
virtual void OnDeinitWindow(int nextWindowID);
- CStdString m_strText;
- CStdString m_strHeading;
+ std::string m_strText;
+ std::string m_strHeading;
void SetText();
void SetHeading();
diff --git a/xbmc/dialogs/GUIDialogYesNo.cpp b/xbmc/dialogs/GUIDialogYesNo.cpp
index 5143ecde25..cb963c8211 100644
--- a/xbmc/dialogs/GUIDialogYesNo.cpp
+++ b/xbmc/dialogs/GUIDialogYesNo.cpp
@@ -108,7 +108,7 @@ bool CGUIDialogYesNo::ShowAndGetInput(int heading, int line0, int line1, int lin
return (dialog->IsConfirmed()) ? true : false;
}
-bool CGUIDialogYesNo::ShowAndGetInput(const CStdString& heading, const CStdString& line0, const CStdString& line1, const CStdString& line2, const CStdString& noLabel, const CStdString& yesLabel)
+bool CGUIDialogYesNo::ShowAndGetInput(const std::string& heading, const std::string& line0, const std::string& line1, const std::string& line2, const std::string& noLabel, const std::string& yesLabel)
{
bool bDummy;
return ShowAndGetInput(heading,line0,line1,line2,bDummy,noLabel,yesLabel);
@@ -134,7 +134,7 @@ bool CGUIDialogYesNo::ShowAndGetInput(const std::string& heading, const std::str
return (dialog->IsConfirmed()) ? true : false;
}
-bool CGUIDialogYesNo::ShowAndGetInput(const CStdString& heading, const CStdString& line0, const CStdString& line1, const CStdString& line2, bool& bCanceled, const CStdString& noLabel, const CStdString& yesLabel)
+bool CGUIDialogYesNo::ShowAndGetInput(const std::string& heading, const std::string& line0, const std::string& line1, const std::string& line2, bool& bCanceled, const std::string& noLabel, const std::string& yesLabel)
{
std::string text = line0 + "\n" + line1 + "\n" + line2;
return ShowAndGetInput(heading, text, bCanceled, noLabel, yesLabel);
diff --git a/xbmc/dialogs/GUIDialogYesNo.h b/xbmc/dialogs/GUIDialogYesNo.h
index e222c12ae5..770c6c9639 100644
--- a/xbmc/dialogs/GUIDialogYesNo.h
+++ b/xbmc/dialogs/GUIDialogYesNo.h
@@ -35,9 +35,9 @@ public:
static bool ShowAndGetInput(int heading, int line0, int line1, int line2, int iNoLabel=-1, int iYesLabel=-1);
static bool ShowAndGetInput(int heading, int line0, int line1, int line2, bool& bCanceled);
static bool ShowAndGetInput(int heading, int line0, int line1, int line2, int iNoLabel, int iYesLabel, bool& bCanceled, unsigned int autoCloseTime = 0);
- static bool ShowAndGetInput(const CStdString& heading, const CStdString& line0, const CStdString& line1, const CStdString& line2, const CStdString& noLabel="", const CStdString& yesLabel="");
+ static bool ShowAndGetInput(const std::string& heading, const std::string& line0, const std::string& line1, const std::string& line2, const std::string& noLabel="", const std::string& yesLabel="");
static bool ShowAndGetInput(const std::string& heading, const std::string& text, bool& bCanceled, const std::string& noLabel, const std::string& yesLabel);
- static bool ShowAndGetInput(const CStdString& heading, const CStdString& line0, const CStdString& line1, const CStdString& line2, bool &bCanceled, const CStdString& noLabel="", const CStdString& yesLabel="");
+ static bool ShowAndGetInput(const std::string& heading, const std::string& line0, const std::string& line1, const std::string& line2, bool &bCanceled, const std::string& noLabel="", const std::string& yesLabel="");
protected:
virtual int GetDefaultLabelID(int controlId) const;
diff --git a/xbmc/network/GUIDialogNetworkSetup.cpp b/xbmc/network/GUIDialogNetworkSetup.cpp
index 92a8de702d..7505850e09 100644
--- a/xbmc/network/GUIDialogNetworkSetup.cpp
+++ b/xbmc/network/GUIDialogNetworkSetup.cpp
@@ -95,7 +95,7 @@ bool CGUIDialogNetworkSetup::OnMessage(CGUIMessage& message)
// \brief Show CGUIDialogNetworkSetup dialog and prompt for a new network address.
// \return True if the network address is valid, false otherwise.
-bool CGUIDialogNetworkSetup::ShowAndGetNetworkAddress(CStdString &path)
+bool CGUIDialogNetworkSetup::ShowAndGetNetworkAddress(std::string &path)
{
CGUIDialogNetworkSetup *dialog = (CGUIDialogNetworkSetup *)g_windowManager.GetWindow(WINDOW_DIALOG_NETWORK_SETUP);
if (!dialog) return false;
@@ -159,11 +159,11 @@ void CGUIDialogNetworkSetup::OnServerBrowse()
{
// open a filebrowser dialog with the current address
VECSOURCES shares;
- CStdString path = ConstructPath();
+ std::string path = ConstructPath();
// get the share as the base path
CMediaSource share;
- CStdString basePath = path;
- CStdString tempPath;
+ std::string basePath = path;
+ std::string tempPath;
while (URIUtils::GetParentPath(basePath, tempPath))
basePath = tempPath;
share.strPath = basePath;
@@ -315,7 +315,7 @@ void CGUIDialogNetworkSetup::UpdateButtons()
m_protocol == NET_PROTOCOL_AFP));
}
-CStdString CGUIDialogNetworkSetup::ConstructPath() const
+std::string CGUIDialogNetworkSetup::ConstructPath() const
{
CURL url;
if (m_protocol == NET_PROTOCOL_SMB)
@@ -374,48 +374,47 @@ CStdString CGUIDialogNetworkSetup::ConstructPath() const
(m_protocol == NET_PROTOCOL_NFS))
&& !m_port.empty() && atoi(m_port.c_str()) > 0)
{
- url.SetPort(atoi(m_port));
+ url.SetPort(atoi(m_port.c_str()));
}
if (!m_path.empty())
url.SetFileName(m_path);
return url.Get();
}
-void CGUIDialogNetworkSetup::SetPath(const CStdString &path)
+void CGUIDialogNetworkSetup::SetPath(const std::string &path)
{
CURL url(path);
- const CStdString &protocol = url.GetProtocol();
- if (protocol == "smb")
+ if (url.IsProtocol("smb"))
m_protocol = NET_PROTOCOL_SMB;
- else if (protocol == "ftp")
+ else if (url.IsProtocol("ftp"))
m_protocol = NET_PROTOCOL_FTP;
- else if (protocol == "http")
+ else if (url.IsProtocol("http"))
m_protocol = NET_PROTOCOL_HTTP;
- else if (protocol == "https")
+ else if (url.IsProtocol("https"))
m_protocol = NET_PROTOCOL_HTTPS;
- else if (protocol == "dav")
+ else if (url.IsProtocol("dav"))
m_protocol = NET_PROTOCOL_DAV;
- else if (protocol == "davs")
+ else if (url.IsProtocol("davs"))
m_protocol = NET_PROTOCOL_DAVS;
- else if (protocol == "daap")
+ else if (url.IsProtocol("daap"))
m_protocol = NET_PROTOCOL_DAAP;
- else if (protocol == "upnp")
+ else if (url.IsProtocol("upnp"))
m_protocol = NET_PROTOCOL_UPNP;
- else if (protocol == "tuxbox")
+ else if (url.IsProtocol("tuxbox"))
m_protocol = NET_PROTOCOL_TUXBOX;
- else if (protocol == "htsp")
+ else if (url.IsProtocol("htsp"))
m_protocol = NET_PROTOCOL_HTSP;
- else if (protocol == "vtp")
+ else if (url.IsProtocol("vtp"))
m_protocol = NET_PROTOCOL_VTP;
- else if (protocol == "myth")
+ else if (url.IsProtocol("myth"))
m_protocol = NET_PROTOCOL_MYTH;
- else if (protocol == "rss")
+ else if (url.IsProtocol("rss"))
m_protocol = NET_PROTOCOL_RSS;
- else if (protocol == "nfs")
+ else if (url.IsProtocol("nfs"))
m_protocol = NET_PROTOCOL_NFS;
- else if (protocol == "sftp" || protocol == "ssh")
+ else if (url.IsProtocol("sftp") || url.IsProtocol("ssh"))
m_protocol = NET_PROTOCOL_SFTP;
- else if (protocol == "afp")
+ else if (url.IsProtocol("afp"))
m_protocol = NET_PROTOCOL_AFP;
else
m_protocol = NET_PROTOCOL_SMB; // default to smb
diff --git a/xbmc/network/GUIDialogNetworkSetup.h b/xbmc/network/GUIDialogNetworkSetup.h
index d0d71cfb00..d5276f4735 100644
--- a/xbmc/network/GUIDialogNetworkSetup.h
+++ b/xbmc/network/GUIDialogNetworkSetup.h
@@ -50,10 +50,10 @@ public:
virtual void OnInitWindow();
virtual void OnDeinitWindow(int nextWindowID);
- static bool ShowAndGetNetworkAddress(CStdString &path);
+ static bool ShowAndGetNetworkAddress(std::string &path);
- CStdString ConstructPath() const;
- void SetPath(const CStdString &path);
+ std::string ConstructPath() const;
+ void SetPath(const std::string &path);
bool IsConfirmed() const { return m_confirmed; };
protected:
@@ -64,11 +64,11 @@ protected:
void UpdateButtons();
NET_PROTOCOL m_protocol;
- CStdString m_server;
- CStdString m_path;
- CStdString m_username;
- CStdString m_password;
- CStdString m_port;
+ std::string m_server;
+ std::string m_path;
+ std::string m_username;
+ std::string m_password;
+ std::string m_port;
bool m_confirmed;
};