summaryrefslogtreecommitdiff
path: root/noncore/settings/aqpkg/mainwin.cpp
Unidiff
Diffstat (limited to 'noncore/settings/aqpkg/mainwin.cpp') (more/less context) (show whitespace changes)
-rw-r--r--noncore/settings/aqpkg/mainwin.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/noncore/settings/aqpkg/mainwin.cpp b/noncore/settings/aqpkg/mainwin.cpp
index 45a6663..42093cf 100644
--- a/noncore/settings/aqpkg/mainwin.cpp
+++ b/noncore/settings/aqpkg/mainwin.cpp
@@ -1003,24 +1003,29 @@ InstallData *MainWindow :: dealWithItem( QCheckListItem *item )
1003 QString dest = "root"; 1003 QString dest = "root";
1004 if ( !p->isInstalled() ) 1004 if ( !p->isInstalled() )
1005 { 1005 {
1006 InstallData *newitem = new InstallData(); 1006 InstallData *newitem = new InstallData();
1007 newitem->option = "I"; 1007 newitem->option = "I";
1008 newitem->packageName = name; 1008 newitem->packageName = name;
1009 return newitem; 1009 return newitem;
1010 } 1010 }
1011 else 1011 else
1012 { 1012 {
1013 InstallData *newitem = new InstallData(); 1013 InstallData *newitem = new InstallData();
1014 newitem->option = "D"; 1014 newitem->option = "D";
1015
1016 // If local file, remove using package name, not filename
1017 if ( p->isPackageStoredLocally() )
1018 name = item->text();
1019
1015 if ( !p->isPackageStoredLocally() ) 1020 if ( !p->isPackageStoredLocally() )
1016 newitem->packageName = p->getInstalledPackageName(); 1021 newitem->packageName = p->getInstalledPackageName();
1017 else 1022 else
1018 newitem->packageName = name; 1023 newitem->packageName = name;
1019 1024
1020 if ( p->getInstalledTo() ) 1025 if ( p->getInstalledTo() )
1021 { 1026 {
1022 newitem->destination = p->getInstalledTo(); 1027 newitem->destination = p->getInstalledTo();
1023 } 1028 }
1024 else 1029 else
1025 { 1030 {
1026 newitem->destination = p->getLocalPackage()->getInstalledTo(); 1031 newitem->destination = p->getLocalPackage()->getInstalledTo();
@@ -1032,24 +1037,28 @@ InstallData *MainWindow :: dealWithItem( QCheckListItem *item )
1032 // If the version requested is older and user selected a local ipk file, then reinstall the file 1037 // If the version requested is older and user selected a local ipk file, then reinstall the file
1033 if ( p->isPackageStoredLocally() && val == -1 ) 1038 if ( p->isPackageStoredLocally() && val == -1 )
1034 val = 0; 1039 val = 0;
1035 1040
1036 if ( val == -2 ) 1041 if ( val == -2 )
1037 { 1042 {
1038 // Error - should handle 1043 // Error - should handle
1039 } 1044 }
1040 else if ( val == -1 ) 1045 else if ( val == -1 )
1041 { 1046 {
1042 // Version available is older - remove only 1047 // Version available is older - remove only
1043 newitem->option = "D"; 1048 newitem->option = "D";
1049
1050 // If local file, remove using package name, not filename
1051 if ( p->isPackageStoredLocally() )
1052 name = item->text();
1044 } 1053 }
1045 else 1054 else
1046 { 1055 {
1047 QString caption; 1056 QString caption;
1048 QString text; 1057 QString text;
1049 QString secondButton; 1058 QString secondButton;
1050 QString secondOption; 1059 QString secondOption;
1051 if ( val == 0 ) 1060 if ( val == 0 )
1052 { 1061 {
1053 // Version available is the same - option to remove or reinstall 1062 // Version available is the same - option to remove or reinstall
1054 caption = tr( "Do you wish to remove or reinstall\n%1?" ); 1063 caption = tr( "Do you wish to remove or reinstall\n%1?" );
1055 text = tr( "Remove or ReInstall" ); 1064 text = tr( "Remove or ReInstall" );
@@ -1071,24 +1080,27 @@ InstallData *MainWindow :: dealWithItem( QCheckListItem *item )
1071 { 1080 {
1072 QString msgtext; 1081 QString msgtext;
1073 msgtext = caption.arg( ( const char * )name ); 1082 msgtext = caption.arg( ( const char * )name );
1074 QuestionDlg dlg( text, msgtext, secondButton ); 1083 QuestionDlg dlg( text, msgtext, secondButton );
1075 switch( dlg.exec() ) 1084 switch( dlg.exec() )
1076 { 1085 {
1077 case 0: // Cancel 1086 case 0: // Cancel
1078 delete newitem; 1087 delete newitem;
1079 return 0x0; 1088 return 0x0;
1080 break; 1089 break;
1081 case 1: // Remove 1090 case 1: // Remove
1082 newitem->option = "D"; 1091 newitem->option = "D";
1092 // If local file, remove using package name, not filename
1093 if ( p->isPackageStoredLocally() )
1094 name = item->text();
1083 break; 1095 break;
1084 case 2: // Reinstall or Upgrade 1096 case 2: // Reinstall or Upgrade
1085 newitem->option = secondOption; 1097 newitem->option = secondOption;
1086 break; 1098 break;
1087 } 1099 }
1088 } 1100 }
1089 else 1101 else
1090 { 1102 {
1091// newitem->option = stickyOption; 1103// newitem->option = stickyOption;
1092 } 1104 }
1093 } 1105 }
1094 1106