Bug 120194

Summary: postgresql setup box contains mysql related options
Product: [Applications] amarok Reporter: Piotr Czerwinski <pius>
Component: generalAssignee: Amarok Developers <amarok-bugs-dist>
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Unlisted Binaries   
OS: Linux   
Latest Commit: Version Fixed In:

Description Piotr Czerwinski 2006-01-15 19:45:29 UTC
Version:           1.4 (current svn version) (using KDE KDE 3.4.3)
Installed from:    Unspecified Linux
OS:                Linux

Problem occurs if amaroK is compiled without MySQL but with PostreSQL support.
In such case collection database combobox contains two entries: SQLite and Postresql.
Choosing Postgresql from the combobox causes MySQL options to be displayed.
Comment 1 Alexandre Oliveira 2006-03-01 04:47:30 UTC
Do you still have this weird problem?
Comment 2 wyvern 2006-04-08 21:52:57 UTC
I still have this problem. It also doesn't show a password text entry box. Here's a text layout version of what it looks like...

MySQL Configuration-----------------------------------------------------------
Hostname: [        entry box                       ] Port: [up/down button box]
Database: [                         entry box      ]
------------------------------------------------------------------------------
Username: [                entry box                       ] Password:
------------------------------------------------------------------------------

The Password: label is on the same line as Username:, as depicted, but without a password box.
Comment 3 Sebastian Kühn 2006-07-07 22:08:00 UTC
I can confirm this bug. The focus order is also strange (e.g. first 'Port' and 'Hostname') then and the port should be the Postgres default 5432 and not 3306.
After restarting amarok (with database set to postgres) the right form appears.
Comment 4 Andreas Kling 2006-08-05 01:17:30 UTC
SVN commit 569848 by kling:

Don't show MySQL settings when compiled with PostgreSQL support only.

BUG: 120194


 M  +9 -0      dbsetup.ui  
 M  +17 -0     dbsetup.ui.h  


--- trunk/extragear/multimedia/amarok/src/dbsetup.ui #569847:569848
@@ -436,6 +436,12 @@
         <receiver>configStack</receiver>
         <slot>raiseWidget(int)</slot>
     </connection>
+    <connection>
+        <sender>databaseEngine</sender>
+        <signal>activated(int)</signal>
+        <receiver>DbSetup</receiver>
+        <slot>databaseEngine_activated(int)</slot>
+    </connection>
 </connections>
 <includes>
     <include location="local" impldecl="in implementation">amarokconfig.h</include>
@@ -443,6 +449,9 @@
     <include location="local" impldecl="in implementation">debug.h</include>
     <include location="local" impldecl="in implementation">dbsetup.ui.h</include>
 </includes>
+<slots>
+    <slot>databaseEngine_activated( int )</slot>
+</slots>
 <functions>
     <function access="private">init()</function>
 </functions>
--- trunk/extragear/multimedia/amarok/src/dbsetup.ui.h #569847:569848
@@ -36,3 +36,20 @@
 #endif
 }
 
+void DbSetup::databaseEngine_activated( int item )
+{
+    if( item == 0 )
+        configStack->raiseWidget( 0 );
+
+    // If built with MySQL support, the PostgreSQL config widget is #2
+    // Without MySQL it's #1
+#ifdef USE_MYSQL
+    else if( item == 1 )
+        configStack->raiseWidget( 1 );
+    else if( item == 2 )
+        configStack->raiseWidget( 2 );
+#elif defined(USE_POSTGRESQL)
+    else if( item == 1 )
+        configStack->raiseWidget( 2 );
+#endif
+}