[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdemultimedia/noatun/library
From:       Stefan Gehn <mETz81 () web ! de>
Date:       2007-01-25 19:24:50
Message-ID: 1169753090.628356.6888.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 627126 by metz:

- try fixing some of the KAction stuff
- deprecated--


 M  +4 -3      hardwarevc.cpp  
 M  +9 -7      nmainwindow.cpp  
 M  +2 -1      noatun/nmainwindow.h  
 M  +16 -14    pluginloader.cpp  
 M  +2 -1      stdaction.cpp  
 M  +3 -3      stereobuttonaction.cpp  


--- trunk/KDE/kdemultimedia/noatun/library/hardwarevc.cpp #627125:627126
@@ -11,7 +11,8 @@
 #include <fcntl.h>
 #include <unistd.h>
 
-using namespace std;
+#include <qfile.h>
+
 using namespace Noatun;
 
 HardwareVC::HardwareVC(const QString &mixerDevice)
@@ -19,7 +20,7 @@
 	if (mixerDevice.isNull())
 		fd = ::open("/dev/mixer", O_RDWR);
 	else
-		fd = ::open(mixerDevice.latin1(), O_RDWR);
+		fd = ::open(QFile::encodeName(mixerDevice), O_RDWR);
 
 	if (fd > -1)
 	{
@@ -65,4 +66,4 @@
 	return left;
 }
 
-#endif
+#endif // HARDWARE_VOLUME
--- trunk/KDE/kdemultimedia/noatun/library/nmainwindow.cpp #627125:627126
@@ -31,7 +31,7 @@
 	//TODO: Should this decision be up to the plugins using NMainWindow?
 	setAttribute(Qt::WA_DeleteOnClose, false);
 
-	//kDebug(66666) << k_funcinfo << "plugin instancename = " << \
plug->instance()->instanceName() << endl; +	kDebug(66666) << k_funcinfo << "plugin \
instancename = " << plug->instance()->instanceName() << endl;  d = new Private;
 //	kapp->ref();
 	d->bMergedNoatunXML = false;
@@ -52,10 +52,10 @@
 
 void NMainWindow::setXMLFile(const QString &file, bool merge, bool setXMLDoc)
 {
-	/*kDebug(66666) << k_funcinfo <<
+	kDebug(66666) << k_funcinfo <<
 		"file = " << file << ", merge = " << merge <<
 		", setXMLDoc = " << setXMLDoc <<
-		";  bMergedNoatunXML = " << d->bMergedNoatunXML << endl;*/
+		";  bMergedNoatunXML = " << d->bMergedNoatunXML << endl;
 
 	// called like this for the kde global rc file, assume our noatun.rc contents are \
lost  if (!merge)
@@ -67,8 +67,8 @@
 	{
 		if (d->bWantMerge && !d->bMergedNoatunXML)
 		{
-			/*kDebug(66666) << k_funcinfo <<
-				"MERGING IN " << locate("data", "noatun/noatun.rc") << endl;*/
+			kDebug(66666) << k_funcinfo <<
+				"MERGING IN " << KStandardDirs::locate("data", "noatun/noatun.rc") << endl;
 
 			KXMLGUIClient::setXMLFile("noatun/noatun.rc", true);
 			d->bMergedNoatunXML = true;
@@ -78,12 +78,14 @@
 		KXMLGUIClient::setXMLFile(file, merge, setXMLDoc);
 }
 
-void NMainWindow::setupGUI(int options, const QString &xmlfile)
+void NMainWindow::setupGUI(StandardWindowOptions options, const QString &xmlfile)
 {
 	kDebug(66666) << k_funcinfo <<
 		"BEGIN; options = " << options << ", xmlfile = '" << xmlfile << "'" << endl;
-	KMainWindow::setupGUI(Default, xmlfile); // TODO KDE4
+
+	KMainWindow::setupGUI(options, xmlfile);
 	updateSkin();
+
 	kDebug(66666) << k_funcinfo << "END" << endl;
 }
 
--- trunk/KDE/kdemultimedia/noatun/library/noatun/nmainwindow.h #627125:627126
@@ -57,7 +57,8 @@
 	 * @short Reimplemented setupGUI from KMainWindow.
 	 * @note Never use createGUI(), use this method instead
 	 **/
-	void setupGUI (int options=ToolBar|Keys|StatusBar|Save|Create, const QString \
&xmlfile=QString::null); +	void setupGUI(StandardWindowOptions options = Default,
+	              const QString &xmlfile = QString::null);
 
 	/**
 	 * Reimplemented for proper systray behaviour.
--- trunk/KDE/kdemultimedia/noatun/library/pluginloader.cpp #627125:627126
@@ -43,6 +43,8 @@
 {
 	kDebug(66666) << k_funcinfo << endl;
 	d = new Private();
+
+	//TODO: this stops us from installing new plugins at runtime
 	d->availablePlugins =
 		KPluginInfo::fromServices(KServiceTypeTrader::self()->query("Noatun/Plugin"));
 }
@@ -105,12 +107,13 @@
 
 PluginList PluginHandler::loadedPluginsByInterface(const QString &interface) const
 {
-	Private::LoadedPluginMap::ConstIterator it;
+	Private::LoadedPluginMap::ConstIterator it(d->loadedPlugins.begin());
+	Private::LoadedPluginMap::ConstIterator end(d->loadedPlugins.end());
 	PluginList result;
 
-	for (it = d->loadedPlugins.begin(); it != d->loadedPlugins.end(); ++it )
+	for (; it != end ; ++it)
 	{
-	  	if (it.key()->property("X-Noatun-Interfaces").toStringList().contains(interface) \
> 0) +		if (it.key()->property("X-Noatun-Interfaces").toStringList().contains(interface))
> 
 			result.append(it.value());
 	}
 
@@ -120,9 +123,10 @@
 
 KPluginInfo *PluginHandler::pluginInfo(const Plugin *plugin) const
 {
-	Private::LoadedPluginMap::ConstIterator it;
+	Private::LoadedPluginMap::ConstIterator it(d->loadedPlugins.begin());
+	Private::LoadedPluginMap::ConstIterator end(d->loadedPlugins.end());
 
-	for (it = d->loadedPlugins.begin(); it != d->loadedPlugins.end(); ++it )
+	for (; it != end ; ++it)
 	{
 		if (it.value() == plugin)
 			return it.key();
@@ -158,28 +162,26 @@
 		if ((*it)->pluginName() == pluginName)
 			return *it;
 	}
-	return 0L;
+	return 0;
 }
 
 
 bool PluginHandler::loadAll()
 {
 	QStringList plugs;
-
 	KConfigGroup pluginGroup(KGlobal::config(), "Plugins");
 
 	// load all other plugins
-	PluginInfoList::ConstIterator it;
-	PluginInfoList::ConstIterator end = d->availablePlugins.end();
-	for (it = d->availablePlugins.begin(); it != end; ++it)
+	PluginInfoList::ConstIterator it(d->availablePlugins.begin());
+	PluginInfoList::ConstIterator end(d->availablePlugins.end());
+	for (; it != end; ++it)
 	{
 		KPluginInfo *p = *it;
 		QStringList interfaces = p->property("X-Noatun-Interfaces").toStringList();
 
-		if (interfaces.contains("engine") == 0 &&
-			interfaces.contains("playlist") == 0 &&
-			interfaces.contains("userinterface") == 0
-			)
+		if (!interfaces.contains("engine") &&
+		    !interfaces.contains("playlist") &&
+		    !interfaces.contains("userinterface"))
 		{
 			p->load(&pluginGroup);
 			if (p->isPluginEnabled())
--- trunk/KDE/kdemultimedia/noatun/library/stdaction.cpp #627125:627126
@@ -33,6 +33,7 @@
 	connect(glob->player(), SIGNAL(playing()), SLOT(playing()));
 	connect(glob->player(), SIGNAL(paused()), SLOT(notplaying()));
 	connect(glob->player(), SIGNAL(stopped()), SLOT(notplaying()));
+	connect(this, SIGNAL(triggered()), SLOT(slotTriggered()));
 
 	glob->player()->isPlaying() ? playing() : notplaying();
 
@@ -43,7 +44,7 @@
 void PlayPauseAction::slotTriggered()
 {
 	mGlobal->player()->playpause();
-	KAction::trigger();
+	//KAction::trigger();
 }
 
 void PlayPauseAction::playing()
--- trunk/KDE/kdemultimedia/noatun/library/stereobuttonaction.cpp #627125:627126
@@ -24,7 +24,7 @@
 	setObjectName(name);
 	setText(text);
 	setShortcut(KShortcut(accel));
-	connect(this, SIGNAL(triggered()), receiver, SLOT(slot));
+	connect(this, SIGNAL(triggered()), receiver, slot);
 }
 #if 0
 StereoButtonAction::StereoButtonAction(const QString& text, const QIconSet& pix, int \
accel, QObject* parent, const char* name ) @@ -42,7 +42,7 @@
 	setObjectName(name);
 	setText(text);
 	setShortcut(KShortcut(accel));
-	connect(this, SIGNAL(triggered()), receiver, SLOT(slot));
+	connect(this, SIGNAL(triggered()), receiver, slot);
 }
 
 StereoButtonAction::StereoButtonAction(const QString& text, const QString& pix, int \
accel, const QObject* receiver, const char* slot, QObject* parent, const char* name ) \
@@ -52,7 +52,7 @@  setText(text);
 	setIcon(KIcon(pix));
 	setShortcut(KShortcut(accel));
-	connect(this, SIGNAL(triggered()), receiver, SLOT(slot));
+	connect(this, SIGNAL(triggered()), receiver, slot);
 }
 
 void StereoButtonAction::disable()


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic