author | andyq <andyq> | 2002-10-22 19:28:22 (UTC) |
---|---|---|
committer | andyq <andyq> | 2002-10-22 19:28:22 (UTC) |
commit | edcbb8b9bae3db2fae18ec6cd9efd202af4f913c (patch) (unidiff) | |
tree | 7a1671b8b8e469a21841348732c6548705f2e5d7 | |
parent | 85f0e72ed11d2c065f46ac0db99483c4025fab8e (diff) | |
download | opie-edcbb8b9bae3db2fae18ec6cd9efd202af4f913c.zip opie-edcbb8b9bae3db2fae18ec6cd9efd202af4f913c.tar.gz opie-edcbb8b9bae3db2fae18ec6cd9efd202af4f913c.tar.bz2 |
Set pIpkg to 0 in constructor
-rw-r--r-- | noncore/settings/aqpkg/installdlgimpl.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/noncore/settings/aqpkg/installdlgimpl.cpp b/noncore/settings/aqpkg/installdlgimpl.cpp index a924daf..f5aef94 100644 --- a/noncore/settings/aqpkg/installdlgimpl.cpp +++ b/noncore/settings/aqpkg/installdlgimpl.cpp | |||
@@ -1,133 +1,134 @@ | |||
1 | /*************************************************************************** | 1 | /*************************************************************************** |
2 | installdlgimpl.cpp - description | 2 | installdlgimpl.cpp - description |
3 | ------------------- | 3 | ------------------- |
4 | begin : Mon Aug 26 2002 | 4 | begin : Mon Aug 26 2002 |
5 | copyright : (C) 2002 by Andy Qua | 5 | copyright : (C) 2002 by Andy Qua |
6 | email : andy.qua@blueyonder.co.uk | 6 | email : andy.qua@blueyonder.co.uk |
7 | ***************************************************************************/ | 7 | ***************************************************************************/ |
8 | 8 | ||
9 | /*************************************************************************** | 9 | /*************************************************************************** |
10 | * * | 10 | * * |
11 | * This program is free software; you can redistribute it and/or modify * | 11 | * This program is free software; you can redistribute it and/or modify * |
12 | * it under the terms of the GNU General Public License as published by * | 12 | * it under the terms of the GNU General Public License as published by * |
13 | * the Free Software Foundation; either version 2 of the License, or * | 13 | * the Free Software Foundation; either version 2 of the License, or * |
14 | * (at your option) any later version. * | 14 | * (at your option) any later version. * |
15 | * * | 15 | * * |
16 | ***************************************************************************/ | 16 | ***************************************************************************/ |
17 | 17 | ||
18 | #ifdef QWS | 18 | #ifdef QWS |
19 | #include <qpe/config.h> | 19 | #include <qpe/config.h> |
20 | #endif | 20 | #endif |
21 | 21 | ||
22 | #include <qmultilineedit.h> | 22 | #include <qmultilineedit.h> |
23 | #include <qdialog.h> | 23 | #include <qdialog.h> |
24 | #include <qcombobox.h> | 24 | #include <qcombobox.h> |
25 | #include <qcheckbox.h> | 25 | #include <qcheckbox.h> |
26 | #include <qpushbutton.h> | 26 | #include <qpushbutton.h> |
27 | 27 | ||
28 | 28 | ||
29 | #include "datamgr.h" | 29 | #include "datamgr.h" |
30 | #include "instoptionsimpl.h" | 30 | #include "instoptionsimpl.h" |
31 | #include "destination.h" | 31 | #include "destination.h" |
32 | #include "installdlgimpl.h" | 32 | #include "installdlgimpl.h" |
33 | #include "global.h" | 33 | #include "global.h" |
34 | 34 | ||
35 | InstallDlgImpl::InstallDlgImpl( vector<InstallData> &packageList, DataManager *dataManager, QWidget * parent, const char* name, bool modal, WFlags fl ) | 35 | InstallDlgImpl::InstallDlgImpl( vector<InstallData> &packageList, DataManager *dataManager, QWidget * parent, const char* name, bool modal, WFlags fl ) |
36 | : InstallDlg( parent, name, modal, fl ) | 36 | : InstallDlg( parent, name, modal, fl ) |
37 | { | 37 | { |
38 | pIpkg = 0; | ||
38 | upgradePackages = false; | 39 | upgradePackages = false; |
39 | dataMgr = dataManager; | 40 | dataMgr = dataManager; |
40 | vector<Destination>::iterator dit; | 41 | vector<Destination>::iterator dit; |
41 | 42 | ||
42 | QString defaultDest = "root"; | 43 | QString defaultDest = "root"; |
43 | #ifdef QWS | 44 | #ifdef QWS |
44 | Config cfg( "aqpkg" ); | 45 | Config cfg( "aqpkg" ); |
45 | cfg.setGroup( "settings" ); | 46 | cfg.setGroup( "settings" ); |
46 | defaultDest = cfg.readEntry( "dest", "root" ); | 47 | defaultDest = cfg.readEntry( "dest", "root" ); |
47 | 48 | ||
48 | // Grab flags - Turn MAKE_LINKS on by default (if no flags found) | 49 | // Grab flags - Turn MAKE_LINKS on by default (if no flags found) |
49 | // flags = cfg.readNumEntry( "installFlags", MAKE_LINKS ); | 50 | // flags = cfg.readNumEntry( "installFlags", MAKE_LINKS ); |
50 | flags = 0; | 51 | flags = 0; |
51 | #else | 52 | #else |
52 | flags = 0; | 53 | flags = 0; |
53 | #endif | 54 | #endif |
54 | 55 | ||
55 | // Output text is read only | 56 | // Output text is read only |
56 | output->setReadOnly( true ); | 57 | output->setReadOnly( true ); |
57 | QFont f( "helvetica" ); | 58 | QFont f( "helvetica" ); |
58 | f.setPointSize( 10 ); | 59 | f.setPointSize( 10 ); |
59 | output->setFont( f ); | 60 | output->setFont( f ); |
60 | 61 | ||
61 | 62 | ||
62 | // setup destination data | 63 | // setup destination data |
63 | int defIndex = 0; | 64 | int defIndex = 0; |
64 | int i; | 65 | int i; |
65 | for ( i = 0 , dit = dataMgr->getDestinationList().begin() ; dit != dataMgr->getDestinationList().end() ; ++dit, ++i ) | 66 | for ( i = 0 , dit = dataMgr->getDestinationList().begin() ; dit != dataMgr->getDestinationList().end() ; ++dit, ++i ) |
66 | { | 67 | { |
67 | destination->insertItem( dit->getDestinationName() ); | 68 | destination->insertItem( dit->getDestinationName() ); |
68 | if ( dit->getDestinationName() == defaultDest ) | 69 | if ( dit->getDestinationName() == defaultDest ) |
69 | defIndex = i; | 70 | defIndex = i; |
70 | } | 71 | } |
71 | 72 | ||
72 | destination->setCurrentItem( defIndex ); | 73 | destination->setCurrentItem( defIndex ); |
73 | 74 | ||
74 | vector<InstallData>::iterator it; | 75 | vector<InstallData>::iterator it; |
75 | // setup package data | 76 | // setup package data |
76 | QString remove = "Remove\n"; | 77 | QString remove = "Remove\n"; |
77 | QString install = "\nInstall\n"; | 78 | QString install = "\nInstall\n"; |
78 | QString upgrade = "\nUpgrade\n"; | 79 | QString upgrade = "\nUpgrade\n"; |
79 | for ( it = packageList.begin() ; it != packageList.end() ; ++it ) | 80 | for ( it = packageList.begin() ; it != packageList.end() ; ++it ) |
80 | { | 81 | { |
81 | InstallData item = *it; | 82 | InstallData item = *it; |
82 | if ( item.option == "I" ) | 83 | if ( item.option == "I" ) |
83 | { | 84 | { |
84 | installList.push_back( item ); | 85 | installList.push_back( item ); |
85 | install += " " + item.packageName + "\n"; | 86 | install += " " + item.packageName + "\n"; |
86 | } | 87 | } |
87 | else if ( item.option == "D" ) | 88 | else if ( item.option == "D" ) |
88 | { | 89 | { |
89 | removeList.push_back( item ); | 90 | removeList.push_back( item ); |
90 | remove += " " + item.packageName + "\n"; | 91 | remove += " " + item.packageName + "\n"; |
91 | } | 92 | } |
92 | else if ( item.option == "U" ) | 93 | else if ( item.option == "U" ) |
93 | { | 94 | { |
94 | updateList.push_back( item ); | 95 | updateList.push_back( item ); |
95 | upgrade += " " + item.packageName + "\n"; | 96 | upgrade += " " + item.packageName + "\n"; |
96 | } | 97 | } |
97 | } | 98 | } |
98 | 99 | ||
99 | output->setText( remove + install + upgrade ); | 100 | output->setText( remove + install + upgrade ); |
100 | } | 101 | } |
101 | 102 | ||
102 | InstallDlgImpl::InstallDlgImpl( Ipkg *ipkg, QString initialText, QWidget *parent, const char *name, bool modal, WFlags fl ) | 103 | InstallDlgImpl::InstallDlgImpl( Ipkg *ipkg, QString initialText, QWidget *parent, const char *name, bool modal, WFlags fl ) |
103 | : InstallDlg( parent, name, modal, fl ) | 104 | : InstallDlg( parent, name, modal, fl ) |
104 | { | 105 | { |
105 | pIpkg = ipkg; | 106 | pIpkg = ipkg; |
106 | output->setText( initialText ); | 107 | output->setText( initialText ); |
107 | } | 108 | } |
108 | 109 | ||
109 | 110 | ||
110 | InstallDlgImpl::~InstallDlgImpl() | 111 | InstallDlgImpl::~InstallDlgImpl() |
111 | { | 112 | { |
112 | } | 113 | } |
113 | 114 | ||
114 | bool InstallDlgImpl :: showDlg() | 115 | bool InstallDlgImpl :: showDlg() |
115 | { | 116 | { |
116 | showMaximized(); | 117 | showMaximized(); |
117 | bool ret = exec(); | 118 | bool ret = exec(); |
118 | 119 | ||
119 | return ret; | 120 | return ret; |
120 | } | 121 | } |
121 | 122 | ||
122 | void InstallDlgImpl :: optionsSelected() | 123 | void InstallDlgImpl :: optionsSelected() |
123 | { | 124 | { |
124 | InstallOptionsDlgImpl opt( flags, this, "Option", true ); | 125 | InstallOptionsDlgImpl opt( flags, this, "Option", true ); |
125 | opt.exec(); | 126 | opt.exec(); |
126 | 127 | ||
127 | // set options selected from dialog | 128 | // set options selected from dialog |
128 | flags = 0; | 129 | flags = 0; |
129 | if ( opt.forceDepends->isChecked() ) | 130 | if ( opt.forceDepends->isChecked() ) |
130 | flags |= FORCE_DEPENDS; | 131 | flags |= FORCE_DEPENDS; |
131 | if ( opt.forceReinstall->isChecked() ) | 132 | if ( opt.forceReinstall->isChecked() ) |
132 | flags |= FORCE_REINSTALL; | 133 | flags |= FORCE_REINSTALL; |
133 | if ( opt.forceRemove->isChecked() ) | 134 | if ( opt.forceRemove->isChecked() ) |