[vlc-devel] commit: Qt: Remove unneeded stuffs from qt4.hpp (Jean-Baptiste Kempf )
git version control
git at videolan.org
Tue Dec 30 13:21:09 CET 2008
vlc | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Mon Dec 29 18:40:21 2008 +0100| [0ac6bc134050244ab3184f065a72816a8a270c6f] | committer: Jean-Baptiste Kempf
Qt: Remove unneeded stuffs from qt4.hpp
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=0ac6bc134050244ab3184f065a72816a8a270c6f
---
modules/gui/qt4/Modules.am | 1 +
modules/gui/qt4/components/open_panels.cpp | 1 +
modules/gui/qt4/components/preferences_widgets.cpp | 1 +
modules/gui/qt4/dialogs/help.cpp | 1 +
modules/gui/qt4/dialogs/playlist.cpp | 2 +
modules/gui/qt4/dialogs/sout.cpp | 1 +
modules/gui/qt4/dialogs_provider.cpp | 2 +-
modules/gui/qt4/main_interface.cpp | 2 +-
modules/gui/qt4/qt4.hpp | 23 ---------
modules/gui/qt4/util/input_slider.hpp | 1 -
modules/gui/qt4/util/qt_dirs.hpp | 51 ++++++++++++++++++++
modules/gui/qt4/util/qvlcapp.hpp | 1 -
12 files changed, 60 insertions(+), 27 deletions(-)
diff --git a/modules/gui/qt4/Modules.am b/modules/gui/qt4/Modules.am
index 5e2f7c4..197a2d7 100644
--- a/modules/gui/qt4/Modules.am
+++ b/modules/gui/qt4/Modules.am
@@ -259,6 +259,7 @@ noinst_HEADERS = \
util/customwidgets.hpp \
util/qvlcframe.hpp \
util/qvlcapp.hpp \
+ util/qt_dirs.hpp \
util/registry.hpp
EXTRA_DIST += \
diff --git a/modules/gui/qt4/components/open_panels.cpp b/modules/gui/qt4/components/open_panels.cpp
index b3368c8..f62c168 100644
--- a/modules/gui/qt4/components/open_panels.cpp
+++ b/modules/gui/qt4/components/open_panels.cpp
@@ -34,6 +34,7 @@
#include "components/open_panels.hpp"
#include "dialogs/open.hpp"
#include "dialogs_provider.hpp" /* Open Subtitle file */
+#include "util/qt_dirs.hpp"
#include <QFileDialog>
#include <QDialogButtonBox>
diff --git a/modules/gui/qt4/components/preferences_widgets.cpp b/modules/gui/qt4/components/preferences_widgets.cpp
index 5d8e3b8..501a6aa 100644
--- a/modules/gui/qt4/components/preferences_widgets.cpp
+++ b/modules/gui/qt4/components/preferences_widgets.cpp
@@ -36,6 +36,7 @@
#include "components/preferences_widgets.hpp"
#include "util/customwidgets.hpp"
+#include "util/qt_dirs.hpp"
#include <vlc_keys.h>
#include <QString>
diff --git a/modules/gui/qt4/dialogs/help.cpp b/modules/gui/qt4/dialogs/help.cpp
index caae1d2..21ce3da 100644
--- a/modules/gui/qt4/dialogs/help.cpp
+++ b/modules/gui/qt4/dialogs/help.cpp
@@ -27,6 +27,7 @@
#endif
#include "dialogs/help.hpp"
+#include "util/qt_dirs.hpp"
#include <vlc_about.h>
#include <vlc_intf_strings.h>
diff --git a/modules/gui/qt4/dialogs/playlist.cpp b/modules/gui/qt4/dialogs/playlist.cpp
index 3ed3cf4..c652396 100644
--- a/modules/gui/qt4/dialogs/playlist.cpp
+++ b/modules/gui/qt4/dialogs/playlist.cpp
@@ -28,6 +28,8 @@
#include "components/playlist/playlist.hpp"
+#include "util/qt_dirs.hpp"
+
#include <QUrl>
#include <QHBoxLayout>
diff --git a/modules/gui/qt4/dialogs/sout.cpp b/modules/gui/qt4/dialogs/sout.cpp
index b173354..e07aafe 100644
--- a/modules/gui/qt4/dialogs/sout.cpp
+++ b/modules/gui/qt4/dialogs/sout.cpp
@@ -32,6 +32,7 @@
#endif
#include "dialogs/sout.hpp"
+#include "util/qt_dirs.hpp"
#include <QString>
#include <QFileDialog>
diff --git a/modules/gui/qt4/dialogs_provider.cpp b/modules/gui/qt4/dialogs_provider.cpp
index e3bd5d7..29dbad3 100644
--- a/modules/gui/qt4/dialogs_provider.cpp
+++ b/modules/gui/qt4/dialogs_provider.cpp
@@ -33,7 +33,7 @@
#include "input_manager.hpp" /* Load Subtitles */
#include "menus.hpp"
#include "recents.hpp"
-#include "util/qvlcapp.hpp" /* DialogEvent */
+#include "util/qt_dirs.hpp"
/* The dialogs */
#include "dialogs/playlist.hpp"
diff --git a/modules/gui/qt4/main_interface.cpp b/modules/gui/qt4/main_interface.cpp
index 12e6bb0..7ea2302 100644
--- a/modules/gui/qt4/main_interface.cpp
+++ b/modules/gui/qt4/main_interface.cpp
@@ -33,7 +33,7 @@
#include "input_manager.hpp"
#include "util/customwidgets.hpp"
-#include "util/qvlcapp.hpp" /* DialogEvent defintion */
+#include "util/qt_dirs.hpp"
#include "components/interface_widgets.hpp"
#include "components/controller.hpp"
diff --git a/modules/gui/qt4/qt4.hpp b/modules/gui/qt4/qt4.hpp
index 3ba526b..cf27ae2 100644
--- a/modules/gui/qt4/qt4.hpp
+++ b/modules/gui/qt4/qt4.hpp
@@ -115,27 +115,4 @@ struct intf_sys_t
#define getSettings() p_intf->p_sys->mainSettings
-#include <QString>
-/* Replace separators on Windows because Qt is always using / */
-static inline QString toNativeSeparators( QString s )
-{
-#ifdef WIN32
- for (int i=0; i<(int)s.length(); i++)
- {
- if (s[i] == QLatin1Char('/'))
- s[i] = QLatin1Char('\\');
- }
-#endif
- return s;
-}
-
-static inline QString removeTrailingSlash( QString s )
-{
- if( ( s.length() > 1 ) && ( s[s.length()-1] == QLatin1Char( '/' ) ) )
- s.remove( s.length() - 1, 1 );
- return s;
-}
-
-#define toNativeSepNoSlash( a ) toNativeSeparators( removeTrailingSlash( a ) )
-
#endif
diff --git a/modules/gui/qt4/util/input_slider.hpp b/modules/gui/qt4/util/input_slider.hpp
index 4ebf5fe..1e6ec6a 100644
--- a/modules/gui/qt4/util/input_slider.hpp
+++ b/modules/gui/qt4/util/input_slider.hpp
@@ -27,7 +27,6 @@
#include "qt4.hpp"
-#include <QAbstractSlider>
#include <QSlider>
#include <QMouseEvent>
diff --git a/modules/gui/qt4/util/qt_dirs.hpp b/modules/gui/qt4/util/qt_dirs.hpp
new file mode 100644
index 0000000..c2af9ce
--- /dev/null
+++ b/modules/gui/qt4/util/qt_dirs.hpp
@@ -0,0 +1,51 @@
+/*****************************************************************************
+ * dirs.hpp : String Directory helpers
+ ****************************************************************************
+ * Copyright (C) 2006-2008 the VideoLAN team
+ * $Id$
+ *
+ * Authors: Jean-Baptiste Kempf <jb at videolan.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ *****************************************************************************/
+
+#ifndef _QT_DIR_H_
+#define _QT_DIR_H_
+
+#include <QString>
+/* Replace separators on Windows because Qt is always using / */
+static inline QString toNativeSeparators( QString s )
+{
+#ifdef WIN32
+ for (int i=0; i<(int)s.length(); i++)
+ {
+ if (s[i] == QLatin1Char('/'))
+ s[i] = QLatin1Char('\\');
+ }
+#endif
+ return s;
+}
+
+static inline QString removeTrailingSlash( QString s )
+{
+ if( ( s.length() > 1 ) && ( s[s.length()-1] == QLatin1Char( '/' ) ) )
+ s.remove( s.length() - 1, 1 );
+ return s;
+}
+
+#define toNativeSepNoSlash( a ) toNativeSeparators( removeTrailingSlash( a ) )
+
+#endif
+
diff --git a/modules/gui/qt4/util/qvlcapp.hpp b/modules/gui/qt4/util/qvlcapp.hpp
index 6cb9fab..a6e8db4 100644
--- a/modules/gui/qt4/util/qvlcapp.hpp
+++ b/modules/gui/qt4/util/qvlcapp.hpp
@@ -50,5 +50,4 @@ protected:
#endif
};
-
#endif
More information about the vlc-devel
mailing list