From kde-commits Mon Aug 31 21:47:42 2009 From: Seb Ruiz Date: Mon, 31 Aug 2009 21:47:42 +0000 To: kde-commits Subject: Re: [Amarok] Revert "MySQL database configuration support. Than Message-Id: <60ebdd0b0908311447u11d12313t61ef85ce5cbba4db () mail ! gmail ! com> X-MARC-Message: https://marc.info/?l=kde-commits&m=125175534324970 Can we re-apply this patch and simply not include the page in the config dialogs? This would allow translators to still see and translate the strings. 2009/9/1 Leo Franchi : > commit 8abba88c0218d4acc3bc9640685410bda5c1254e > Author:     Leo Franchi > AuthorDate: Mon Aug 31 11:34:44 2009 -0400 > Commit:     Leo Franchi > CommitDate: Mon Aug 31 11:34:44 2009 -0400 > >    Revert "MySQL database configuration support. Thanks to John Atkinson for the patch!" > >    Will re-apply after tagging and try to fix, but for now the crashes and kcfg issues are not release-worthy > >    This reverts commit 698fd3c2b47f876b5ef053d0028d594ca8e34df9. > > diff --git a/ChangeLog b/ChangeLog > index 3367f14..da3b3d5 100644 > --- a/ChangeLog > +++ b/ChangeLog > @@ -64,7 +64,8 @@ VERSION 2.2-beta1 >       The video can be appended to the playlist, and rendered within the applet. >     * Photo applet to show images from Flickr, with customizable animations. >     * Customizable user interface using dock widgets. > -    * Support for external MySQL database. > +    * Support for external MySQL database. See > +      http://amarok.kde.org/wiki/MySQL_Server. >     * GHNS integration for downloading and installing Context applets. >     * Support for Context applets to be written in QtScript. >     * Custom Dynamic Playlists using Last.fm. > diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt > index cab1d28..323fe0d 100644 > --- a/src/CMakeLists.txt > +++ b/src/CMakeLists.txt > @@ -187,7 +187,6 @@ set(libconfigdialog_SRCS >     configdialog/dialogs/OsdConfig.cpp >     configdialog/dialogs/PlaybackConfig.cpp >     configdialog/dialogs/ServiceConfig.cpp > -    configdialog/dialogs/DatabaseConfig.cpp >  ) > >  kde4_add_ui_files(libconfigdialog_SRCS > @@ -195,7 +194,6 @@ kde4_add_ui_files(libconfigdialog_SRCS >     configdialog/dialogs/GeneralConfig.ui >     configdialog/dialogs/OsdConfig.ui >     configdialog/dialogs/PlaybackConfig.ui > -    configdialog/dialogs/DatabaseConfig.ui >  ) > >  set(libbrowserframework_SRCS > diff --git a/src/configdialog/ConfigDialog.cpp b/src/configdialog/ConfigDialog.cpp > index 58bcb48..e4a2072 100644 > --- a/src/configdialog/ConfigDialog.cpp > +++ b/src/configdialog/ConfigDialog.cpp > @@ -27,7 +27,6 @@ >  #include "OsdConfig.h" >  #include "PlaybackConfig.h" >  #include "ServiceConfig.h" > -#include "DatabaseConfig.h" > >  #include > > @@ -48,7 +47,6 @@ Amarok2ConfigDialog::Amarok2ConfigDialog( QWidget *parent, const char* name, KCo >     ConfigDialogBase* services    = new ServiceConfig( this ); >     ConfigDialogBase* playback    = new PlaybackConfig( this ); >     ConfigDialogBase* osd         = new OsdConfig( this ); > -    ConfigDialogBase* database    = new DatabaseConfig( this ); > >     connect( general, SIGNAL( lockLayout( bool ) ), The::mainWindow(), SLOT ( setLayoutLocked( bool ) ) ); > > @@ -59,7 +57,6 @@ Amarok2ConfigDialog::Amarok2ConfigDialog( QWidget *parent, const char* name, KCo >     addPage( services,    i18n( "Internet Services" ), "services-amarok", i18n( "Configure Services" ) ); >     addPage( playback,    i18n( "Playback" ), "preferences-media-playback-amarok", i18n( "Configure Playback" ) ); >     addPage( osd,         i18n( "On Screen Display" ), "preferences-indicator-amarok", i18n( "Configure On-Screen-Display" ) ); > -    addPage( database,    i18n( "Database" ), "server-database", i18n( "Configure Database" ) ); >  //    addPage( mediadevice, i18n( "Media Devices" ), "preferences-multimedia-player-amarok", i18n( "Configure Portable Player Support" ) ); > >     setButtons( Help | Ok | Apply | Cancel ); > diff --git a/src/configdialog/dialogs/DatabaseConfig.cpp b/src/configdialog/dialogs/DatabaseConfig.cpp > deleted file mode 100644 > index 8f4bba7..0000000 > --- a/src/configdialog/dialogs/DatabaseConfig.cpp > +++ /dev/null > @@ -1,158 +0,0 @@ > -/**************************************************************************************** > - * Copyright (c) 2009 John Atkinson                              * > - *                                                                                      * > - * 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, see .                           * > - ****************************************************************************************/ > - > -#include "DatabaseConfig.h" > - > -#include "Amarok.h" > -#include "Debug.h" > - > -#include > - > - > -DatabaseConfig::DatabaseConfig( QWidget* parent ) > -    : ConfigDialogBase( parent ) > -{ > -    setupUi( this ); > - > -    // Fix some weird tab orderness > -    setTabOrder( kcfg_Server,   kcfg_Port );     // server to port > -    setTabOrder( kcfg_Port,     kcfg_Username ); // port to username > -    setTabOrder( kcfg_Username, kcfg_Password ); // username to password > -    setTabOrder( kcfg_Password, kcfg_DBName );   // password to database > - > -    readConfiguration(); > - > -    connect( kcfg_UseInternalDB, SIGNAL( stateChanged(int) ), SLOT( toggleExternalConfigAvailable(int) ) ); > - > -    connect( kcfg_DBName,   SIGNAL( textChanged(const QString &) ), SLOT( updateSQLQuery() ) ); > -    connect( kcfg_Username, SIGNAL( textChanged(const QString &) ), SLOT( updateSQLQuery() ) ); > -    connect( kcfg_Server,   SIGNAL( textChanged(const QString &) ), SLOT( updateSQLQuery() ) ); > - > -} > - > -DatabaseConfig::~DatabaseConfig() > -{} > - > - > -/////////////////////////////////////////////////////////////// > -// REIMPLEMENTED METHODS from ConfigDialogBase > -/////////////////////////////////////////////////////////////// > - > -bool > -DatabaseConfig::hasChanged() > -{ > -    return false; > -} > - > -bool > -DatabaseConfig::isDefault() > -{ > -    return false; > -} > - > -void > -DatabaseConfig::updateSettings() > -{ > -    writeConfiguration(); > -} > - > - > -/////////////////////////////////////////////////////////////// > -// PRIVATE METHODS > -/////////////////////////////////////////////////////////////// > - > -void > -DatabaseConfig::readConfiguration() > -{ > -    KConfigGroup config = Amarok::config( "MySQL" ); > - > -    kcfg_UseInternalDB->setChecked( !config.readEntry( "UseServer", false ) ); > - > -    kcfg_Server->setText( config.readEntry( "Host", "localhost" ).toUtf8() ); > -    kcfg_Port->setValue( config.readEntry( "Port", "3306" ).toInt() ); > -    kcfg_DBName->setText( config.readEntry( "Database", "amarokdb" ).toUtf8() ); > - > -    kcfg_Username->setText( config.readEntry( "User", "amarokuser" ).toUtf8() ); > -    kcfg_Password->setText( config.readEntry( "Password", "" ).toUtf8() ); > - > - > -    toggleExternalConfigAvailable( kcfg_UseInternalDB->checkState() ); > -    updateSQLQuery(); > -} > - > -void > -DatabaseConfig::writeConfiguration() > -{ > -    KConfigGroup config = Amarok::config( "MySQL" ); > - > -    const bool useExternal = kcfg_UseInternalDB->checkState() != Qt::Checked; > - > -    config.writeEntry( "UseServer", useExternal ); > - > -    if( useExternal ) > -    { > -        config.writeEntry( "Host",     kcfg_Server->text() ); > -        config.writeEntry( "Port",     kcfg_Port->value() ); > -        config.writeEntry( "Database", kcfg_DBName->text() ); > -        config.writeEntry( "User",     kcfg_Username->text() ); > -        config.writeEntry( "Password", kcfg_Password->text() ); > -    } > -} > - > - > -void > -DatabaseConfig::toggleExternalConfigAvailable( const int checkBoxState ) //SLOT > -{ > -    const bool enableExternalConfig = checkBoxState != Qt::Checked; > - > -    label_DatabaseEngine->setEnabled( enableExternalConfig ); > -    kcfg_DatabaseEngine->setEnabled( enableExternalConfig ); > -    group_Connection->setVisible( enableExternalConfig ); > - > -} > - > -void > -DatabaseConfig::updateSQLQuery() //SLOT > -{ > -    QString query; > - > -    if( isSQLInfoPresent() ) > -    { > -        // Query template: > -        // GRANT ALL ON amarokdb.* TO 'amarokuser'@'localhost' IDENTIFIED BY 'mypassword'; FLUSH PRIVILEGES; > - > -        // Don't print the actual password! > -        const QString examplePassword = i18nc( "A default password for insertion into an example SQL command (so as not to print the real one). To be manually replaced by the user.", "password" ); > -        query = QString( "GRANT ALL ON %1.* TO '%2'@'%3' IDENTIFIED BY '%4';\nFLUSH PRIVILEGES;" ) > -                   .arg( kcfg_DBName->text() ) > -                   .arg( kcfg_Username->text() ) > -                   .arg( kcfg_Server->text() ) > -                   .arg( examplePassword ); > -    } > -    text_SQL->setPlainText( query ); > -} > - > - > -inline bool > -DatabaseConfig::isSQLInfoPresent() const > -{ > -    return !kcfg_DBName->text().isEmpty() && !kcfg_Username->text().isEmpty() && !kcfg_Server->text().isEmpty(); > -} > - > - > -#include "DatabaseConfig.moc" > - > - > diff --git a/src/configdialog/dialogs/DatabaseConfig.h b/src/configdialog/dialogs/DatabaseConfig.h > deleted file mode 100644 > index f19481a..0000000 > --- a/src/configdialog/dialogs/DatabaseConfig.h > +++ /dev/null > @@ -1,51 +0,0 @@ > -/**************************************************************************************** > - * Copyright (c) 2009 John Atkinson                              * > - *                                                                                      * > - * 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, see .                           * > - ****************************************************************************************/ > - > -#ifndef DATABASECONFIG_H > -#define DATABASECONFIG_H > - > -#include "ui_DatabaseConfig.h" > -#include "ConfigDialogBase.h" > - > - > -class DatabaseConfig : public ConfigDialogBase, public Ui_DatabaseConfig > -{ > -    Q_OBJECT > - > -    public: > -        DatabaseConfig( QWidget* parent ); > -        virtual ~DatabaseConfig(); > - > -        virtual bool hasChanged(); > -        virtual bool isDefault(); > -        virtual void updateSettings(); > - > -    protected: > -        void readConfiguration(); > -        void writeConfiguration(); > - > -    private slots: > -        void toggleExternalConfigAvailable( const int checkBoxState ); > -        void updateSQLQuery(); > - > -    private: > -        inline bool isSQLInfoPresent() const; > -}; > - > - > -#endif > - > - > diff --git a/src/configdialog/dialogs/DatabaseConfig.ui b/src/configdialog/dialogs/DatabaseConfig.ui > deleted file mode 100644 > index 02e2ea7..0000000 > --- a/src/configdialog/dialogs/DatabaseConfig.ui > +++ /dev/null > @@ -1,294 +0,0 @@ > - > - > - DatabaseConfig > - > -   > -   > -    0 > -    0 > -    440 > -    426 > -   > -   > -   > -   > -     > -     > -      Use &internal database (default) > -     > -     > -   > -   > -     > -     > -       > -       > -         > -         0 > -         0 > -         > -       > -       > -         > -         MySQL > -         > -       > -       > -     > -     > -       > -       > -        true > -       > -       > -        &External database engine: > -       > -       > -        kcfg_DatabaseEngine > -       > -       > -     > -     > -   > -   > -     > -     > -      Connection Settings > -     > -     > -       > -       > -         > -         > -           > -           &Server: > -           > -           > -           Qt::AutoText > -           > -           > -           Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter > -           > -           > -           kcfg_Server > -           > -         > -         > -         > -         > -           > -           > -           > -         > -         > -         > -         > -           > -           > -            0 > -            0 > -           > -           > -           > -           P&ort: > -           > -           > -           Qt::AutoText > -           > -           > -           Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter > -           > -           > -           2 > -           > -           > -           kcfg_Port > -           > -         > -         > -         > -         > -           > -           65535 > -           > -         > -         > -         > -         > -           > -           &Username: > -           > -           > -           Qt::AutoText > -           > -           > -           Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter > -           > -           > -           kcfg_Username > -           > -         > -         > -         > -         > -           > -           > -           > -           > -           > -           > -           > -           QLineEdit::Password > -           > -         > -         > -         > -         > -           > -           &Password: > -           > -           > -           Qt::AutoText > -           > -           > -           Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter > -           > -           > -           kcfg_Password > -           > -         > -         > -         > -         > -           > -           > -           > -         > -         > -         > -         > -           > -           &Database: > -           > -           > -           Qt::AutoText > -           > -           > -           Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter > -           > -           > -           kcfg_DBName > -           > -         > -         > -         > -         > -           > -           > -           > -         > -         > -       > -       > -       > -       > -         > -         QFrame::StyledPanel > -         > -         > -         QFrame::Raised > -         > -         > -         > -           > -           > -             > -             9 > -             > -           > -           > -            Amarok expects the above database and user account to already exist. This user also requires full access to the database. > -           > -           > -            Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter > -           > -           > -            true > -           > -           > -         > -         > -           > -           > -             > -             9 > -             > -           > -           > -            Access rights can be assigned with the following S&QL commands (after replacing the password with the correct one): > -           > -           > -            true > -           > -           > -            text_SQL > -           > -           > -         > -         > -           > -           > -             > -             0 > -             0 > -             > -           > -           > -             > -             16777215 > -             50 > -             > -           > -           > -             > -             9 > -             > -           > -           > -            ArrowCursor > -           > -           > -            false > -           > -           > -            true > -           > -           > -             > -           > -           > -         > -         > -       > -       > -     > -     > -   > -   > -     > -     > -      Qt::Vertical > -     > -     > -       > -       20 > -       40 > -       > -     > -     > -   > -   > - > - > - > - > > > -- Seb Ruiz http://www.sebruiz.net/ http://amarok.kde.org/