From 24f699beb4ce08f4ba131aa8145b3e0635470598 Mon Sep 17 00:00:00 2001 From: Daniel Svensson Date: Tue, 7 Mar 2006 14:13:21 +0100 Subject: [PATCH] Remove "using namespace" from header files and change std::strings to QStrings. --- Button.h | 2 -- MainDisplay.h | 2 -- MainWindow.h | 2 -- Skin.cpp | 11 +++++------ Skin.h | 11 ++++------- TitleBar.h | 2 -- 6 files changed, 9 insertions(+), 21 deletions(-) diff --git a/Button.h b/Button.h index 34cd0ba..e493b1f 100644 --- a/Button.h +++ b/Button.h @@ -3,8 +3,6 @@ #include "PixWidget.h" -using namespace std; - class Button : public PixWidget { Q_OBJECT diff --git a/MainDisplay.h b/MainDisplay.h index 7ea0d6c..eae213d 100644 --- a/MainDisplay.h +++ b/MainDisplay.h @@ -25,8 +25,6 @@ class MainDisplay; #include "PlayStatus.h" #include "MainWindow.h" -using namespace std; - class MainDisplay : public SkinDisplay { Q_OBJECT diff --git a/MainWindow.h b/MainWindow.h index 883576a..4fe5e52 100644 --- a/MainWindow.h +++ b/MainWindow.h @@ -20,8 +20,6 @@ class MainWindow; #include "ShadedDisplay.h" #include "Playlist.h" -using namespace std; - class MainWindow : public QMainWindow { Q_OBJECT diff --git a/Skin.cpp b/Skin.cpp index b25a8ee..8218908 100644 --- a/Skin.cpp +++ b/Skin.cpp @@ -82,7 +82,7 @@ Skin::BuildPlaylist (void) } void -Skin::setSkin (QString name) +Skin::setSkin (const QString& name) { m_path = name; @@ -110,7 +110,7 @@ Skin::setSkin (QString name) } QPixmap -Skin::getPixmap (QString f, QDir dir) +Skin::getPixmap (const QString& file, QDir dir) { /* check for files in zip and check if file exists */ @@ -120,7 +120,7 @@ Skin::getPixmap (QString f, QDir dir) for (int i = 0; i < list.size(); ++i) { QFileInfo fileInfo = list.at(i); QString fname = fileInfo.fileName().toLower(); - if (fname.section(".", 0, 0) == f) { + if (fname.section(".", 0, 0) == file) { return QPixmap (fileInfo.filePath()); } } @@ -130,10 +130,9 @@ Skin::getPixmap (QString f, QDir dir) QPixmap * -Skin::getPixmap (string file) +Skin::getPixmap (const QString& file) { QDir dir; - QString f = QString::fromStdString (file); dir.setPath (m_path); dir.setFilter (QDir::Files); @@ -142,7 +141,7 @@ Skin::getPixmap (string file) for (int i = 0; i < list.size(); ++i) { QFileInfo fileInfo = list.at(i); QString fname = fileInfo.fileName().toLower(); - if (fname.section(".", 0, 0) == f) { + if (fname.section(".", 0, 0) == file) { return new QPixmap (fileInfo.filePath()); } } diff --git a/Skin.h b/Skin.h index edd9d33..0414031 100644 --- a/Skin.h +++ b/Skin.h @@ -9,8 +9,6 @@ #include #include -using namespace std; - class Skin : public QWidget { Q_OBJECT @@ -19,8 +17,8 @@ class Skin : public QWidget Skin (); ~Skin(); - void setSkin (QString name); - static QPixmap getPixmap (QString, QDir); + void setSkin (const QString& name); + static QPixmap getPixmap (const QString&, QDir); const QPixmap getItem (uint part) const { return m_items->value(part); } const QPixmap getPls (uint part) const { return m_playlist->value(part); } @@ -194,8 +192,7 @@ class Skin : public QWidget private: static Skin *singleton; - QPixmap *Skin::getPixmap (string file); - void Parse (string file); + QPixmap *Skin::getPixmap (const QString& file); void BuildLetterMap (void); void BuildButtons (void); void BuildToggleButtons (void); @@ -207,7 +204,7 @@ class Skin : public QWidget void ParsePLEdit (void); - string m_skinname; + QString m_skinname; QString m_path; QHash *m_items; diff --git a/TitleBar.h b/TitleBar.h index 9c3fa6e..81237f1 100644 --- a/TitleBar.h +++ b/TitleBar.h @@ -6,8 +6,6 @@ class TitleBar; #include "PixWidget.h" #include "Button.h" -using namespace std; - class TitleBar : public PixWidget { Q_OBJECT