3030#include " iconcache.h"
3131#include " termsdialog.h"
3232
33- #define DBG_LOCAL 1
33+ #define DBG_LOCAL 0
3434#define LOCAL_DO_DBG 1
3535#define LOCAL_DBG_FUNC 1
36- #define LOCAL_DBG_OUT 0
36+ #define LOCAL_DBG_OUT 1
3737#define LOCAL_DBG_MSG 0
3838#include " mydebug.h"
3939
@@ -231,7 +231,10 @@ MainWindow::MainWindow(const QString &drive, const QString &defaultDisplay, KSpl
231231
232232 ug = new OsGroup (this , ui, !cmdline.contains (" no_group" ));
233233
234- ug->list ->setIconSize (QSize (40 ,40 )); // ALL?? set each list?
234+ _currentsize = QSize (40 ,40 );
235+ ug->list ->setIconSize (_currentsize); // ALL?? set each list?
236+ ug->listInstalled ->setIconSize (_currentsize); // ALL?? set each list?
237+
235238 connect (ug->list , SIGNAL (currentRowChanged (int )), this , SLOT (on_list_currentRowChanged (void )));
236239 connect (ug->list , SIGNAL (doubleClicked (const QModelIndex&)), this , SLOT (on_list_doubleClicked (const QModelIndex&)));
237240 connect (ug->list , SIGNAL (itemChanged (QListWidgetItem *)), this , SLOT (on_list_itemChanged (QListWidgetItem *)));
@@ -722,7 +725,7 @@ void MainWindow::repopulate()
722725{
723726 TRACE
724727 QMap<QString,QVariantMap> images;
725- _currentsize = ug-> list -> iconSize ();
728+
726729 QIcon localIcon (" :/icons/hdd.png" );
727730
728731 if ( _sdimages )
@@ -2451,7 +2454,6 @@ void MainWindow::assignPixmap(QString originalurl, QPixmap &pix)
24512454 for (int i=0 ; i<ug->count (); i++)
24522455 {
24532456 QVariantMap m = all.value (i)->data (Qt::UserRole).toMap ();
2454- ug->list ->setIconSize (QSize (40 ,40 )); // ALL??
24552457 if (m.value (" icon" ) == originalurl)
24562458 {
24572459 all.value (i)->setIcon (icon);
@@ -3154,19 +3156,24 @@ void MainWindow::startImageDownload()
31543156 }
31553157
31563158 /* Insert tarball download URL information into partition_info.json to allow download */
3157- QVariantMap json = Json::loadFromFile (folder+" /partitions.json" ).toMap ();
3158- QVariantList partitions = json[" partitions" ].toList ();
3159- int i=0 ;
3160- QStringList tarballs = entry.value (" tarballs" ).toStringList ();
3161- foreach (QString tarball, tarballs)
3159+ if (QFile::exists (folder+" /partitions.json" ))
31623160 {
3163- QVariantMap partition = partitions[i].toMap ();
3164- partition.insert (" download" , tarball);
3165- partitions[i] = partition;
3166- i++;
3161+ QVariantMap json = Json::loadFromFile (folder+" /partitions.json" ).toMap ();
3162+ QVariantList partitions = json[" partitions" ].toList ();
3163+ int i=0 ;
3164+ QStringList tarballs = entry.value (" tarballs" ).toStringList ();
3165+ foreach (QString tarball, tarballs)
3166+ {
3167+ QVariantMap partition = partitions[i].toMap ();
3168+ partition.insert (" download" , tarball);
3169+ partitions[i] = partition;
3170+ i++;
3171+ }
3172+ json[" partitions" ] = partitions;
3173+ Json::saveToFile (folder+" /partitions.json" , json);
31673174 }
3168- json[ " partitions " ] = partitions;
3169- Json::saveToFile (folder+ " /partitions.json " , json) ;
3175+ else
3176+ continue ;
31703177
31713178 slidesFolder.clear ();
31723179 if (QFile::exists (folder+" /slides_vga" ))
@@ -3175,13 +3182,18 @@ void MainWindow::startImageDownload()
31753182 }
31763183
31773184 /* Insert download_size into os.json to allow correct use of download size */
3178- json = Json::loadFromFile (folder+" /os.json" ).toMap ();
3179- if (! json.contains (" download_size" ))
3185+ if (QFile::exists (folder+" /os.json" ))
31803186 {
3181- quint64 downloadSize= entry.value (" download_size" ).toULongLong ();
3182- json.insert (" download_size" ,downloadSize);
3183- Json::saveToFile (folder+" /os.json" , json);
3187+ QVariantMap json = Json::loadFromFile (folder+" /os.json" ).toMap ();
3188+ if (! json.contains (" download_size" ))
3189+ {
3190+ quint64 downloadSize= entry.value (" download_size" ).toULongLong ();
3191+ json.insert (" download_size" ,downloadSize);
3192+ Json::saveToFile (folder+" /os.json" , json);
3193+ }
31843194 }
3195+ else
3196+ continue ;
31853197
31863198 QString sTerms (folder+" /terms" );
31873199 bool allowContinue=true ;
@@ -3856,18 +3868,6 @@ void MainWindow::addImage(QVariantMap& m, QIcon &icon, bool &bInstalled)
38563868 /* Icon file corrupt */
38573869 iconos = QIcon ();
38583870 }
3859- else
3860- {
3861- QSize iconsize = avs.first ();
3862-
3863- if (iconsize.width () > _currentsize.width () || iconsize.height () > _currentsize.height ())
3864- {
3865- /* Make all icons as large as the largest icon we have */
3866- _currentsize = QSize (qMax (iconsize.width (), _currentsize.width ()),qMax (iconsize.height (), _currentsize.height ()));
3867- ug->list ->setIconSize (_currentsize);
3868- ug->listInstalled ->setIconSize (_currentsize);
3869- }
3870- }
38713871 witem->setIcon (iconos);
38723872 }
38733873 if (bInstalled)
@@ -4741,7 +4741,7 @@ void MainWindow::on_actionBackup_triggered()
47414741 iconfilename = entry.value (" icon" ).toString ();
47424742 else
47434743 iconfilename = settingsFolder+" /icon.png" ;
4744- cmd = " cp " + iconfilename+" " +backupFolder+" /" +CORE (backupName)+" .png" ;
4744+ cmd = " cp " + iconfilename+" " +backupFolder+" /" +CORE (backupName). replace ( ' ' , ' _ ' ) +" .png" ;
47454745 errors += QProcess::execute (cmd);
47464746
47474747 // - [Copy release_notes.txt?]
0 commit comments