extragear/multimedia/amarok/src/dialogs

Leo Franchi lfranchi at kde.org
Mon Feb 23 00:59:27 CET 2009


SVN commit 930301 by lfranchi:

don't erroneously mark a field as edited when we clear it manually to add completion items. thanks for the patch/inspiration go to Simon Esneault.

as usual with TagDialog spaghetti code, touching one thing may subtly break 5 others. so please try to edit some track details and make sure the completions work OK as well as saving to file.

CCMAIL: amarok-devel at kde.org
BUG: 174878

 M  +10 -1     TagDialog.cpp  


--- trunk/extragear/multimedia/amarok/src/dialogs/TagDialog.cpp #930300:930301
@@ -233,10 +233,17 @@
 
     m_dataQueryMaker->deleteLater();
     m_dataQueryMaker = 0;
+
+    // basically we want to ignore the fact that the fields are being
+    // edited because we do it not the user, so it results in empty
+    // tags being saved to files---data loss is BAD!
+    QMap< QString, bool > m_fieldEditedSave = m_fieldEdited;
+  
     //we simply clear the completion data of all comboboxes
     //then load the current track again. that's more work than necessary
     //but the performance impact should be negligible
-
+    // we do this because if we insert items and the contents of the textbox
+    // are not in the list, it clears the textbox. which is bad --lfranchi 2.22.09  
     QString saveText( ui->kComboBox_artist->lineEdit()->text() );
     ui->kComboBox_artist->clear();
     ui->kComboBox_artist->insertItems( 0, m_artists );
@@ -257,6 +264,8 @@
     ui->kComboBox_genre->insertItems( 0, m_genres );
     ui->kComboBox_genre->lineEdit()->setText( saveText );
 
+    m_fieldEdited = m_fieldEditedSave;
+    
     if( !m_queryMaker )  //track query complete or not necessary
     {
         if( m_perTrack )


More information about the Amarok-devel mailing list