author | drw <drw> | 2004-01-13 21:46:50 (UTC) |
---|---|---|
committer | drw <drw> | 2004-01-13 21:46:50 (UTC) |
commit | 4dae04411e1cd75237b89dee6b5d6ba74089505d (patch) (unidiff) | |
tree | 1704e1ec9dc235817436568fd9354824c3279a7e | |
parent | 4a48472bbe915852ed6eaa66284b8b8c0f3b493d (diff) | |
download | opie-4dae04411e1cd75237b89dee6b5d6ba74089505d.zip opie-4dae04411e1cd75237b89dee6b5d6ba74089505d.tar.gz opie-4dae04411e1cd75237b89dee6b5d6ba74089505d.tar.bz2 |
Add .cvsignore and fix sigsev when updating and upgrading
-rw-r--r-- | noncore/settings/packagemanager/.cvsignore | 3 | ||||
-rw-r--r-- | noncore/settings/packagemanager/installdlg.cpp | 7 |
2 files changed, 8 insertions, 2 deletions
diff --git a/noncore/settings/packagemanager/.cvsignore b/noncore/settings/packagemanager/.cvsignore new file mode 100644 index 0000000..4183697 --- a/dev/null +++ b/noncore/settings/packagemanager/.cvsignore | |||
@@ -0,0 +1,3 @@ | |||
1 | Makefile* | ||
2 | moc* | ||
3 | .moc* | ||
diff --git a/noncore/settings/packagemanager/installdlg.cpp b/noncore/settings/packagemanager/installdlg.cpp index c0c03fc..980d5eb 100644 --- a/noncore/settings/packagemanager/installdlg.cpp +++ b/noncore/settings/packagemanager/installdlg.cpp | |||
@@ -152,127 +152,130 @@ InstallDlg::InstallDlg( QWidget *parent, OPackageManager *pm, const QString &cap | |||
152 | } | 152 | } |
153 | 153 | ||
154 | m_output->append( lineStr ); | 154 | m_output->append( lineStr ); |
155 | } | 155 | } |
156 | } | 156 | } |
157 | 157 | ||
158 | m_output->append( tr( "Press the start button to begin.\n" ) ); | 158 | m_output->append( tr( "Press the start button to begin.\n" ) ); |
159 | m_output->setCursorPosition( m_output->numLines(), 0 ); | 159 | m_output->setCursorPosition( m_output->numLines(), 0 ); |
160 | 160 | ||
161 | } | 161 | } |
162 | 162 | ||
163 | InstallDlg::~InstallDlg() | 163 | InstallDlg::~InstallDlg() |
164 | { | 164 | { |
165 | for( int i = 0; i < m_numCommands; i++ ) | 165 | for( int i = 0; i < m_numCommands; i++ ) |
166 | { | 166 | { |
167 | if ( m_packages[ i ] ) | 167 | if ( m_packages[ i ] ) |
168 | delete m_packages[ i ]; | 168 | delete m_packages[ i ]; |
169 | } | 169 | } |
170 | } | 170 | } |
171 | 171 | ||
172 | void InstallDlg::slotDisplayAvailSpace( const QString &destination ) | 172 | void InstallDlg::slotDisplayAvailSpace( const QString &destination ) |
173 | { | 173 | { |
174 | // If available space is not displayed, exit | 174 | // If available space is not displayed, exit |
175 | if ( !m_availSpace ) | 175 | if ( !m_availSpace ) |
176 | return; | 176 | return; |
177 | 177 | ||
178 | QString space = tr( "Unknown" ); | 178 | QString space = tr( "Unknown" ); |
179 | 179 | ||
180 | // Get destination | 180 | // Get destination |
181 | OConfItem *dest = m_packman->findConfItem( OConfItem::Destination, destination ); | 181 | OConfItem *dest = m_packman->findConfItem( OConfItem::Destination, destination ); |
182 | 182 | ||
183 | if ( dest ) | 183 | if ( dest ) |
184 | { | 184 | { |
185 | // Calculate available space | 185 | // Calculate available space |
186 | struct statfs fs; | 186 | struct statfs fs; |
187 | if ( !statfs( dest->value(), &fs ) ) | 187 | if ( !statfs( dest->value(), &fs ) ) |
188 | { | 188 | { |
189 | long mult = fs.f_bsize / 1024; | 189 | long mult = fs.f_bsize / 1024; |
190 | long div = 1024 / fs.f_bsize; | 190 | long div = 1024 / fs.f_bsize; |
191 | 191 | ||
192 | if ( !mult ) mult = 1; | 192 | if ( !mult ) mult = 1; |
193 | if ( !div ) div = 1; | 193 | if ( !div ) div = 1; |
194 | long avail = fs.f_bavail * mult / div; | 194 | long avail = fs.f_bavail * mult / div; |
195 | 195 | ||
196 | space = tr( "%1 Kb" ).arg( avail ); | 196 | space = tr( "%1 Kb" ).arg( avail ); |
197 | } | 197 | } |
198 | } | 198 | } |
199 | 199 | ||
200 | // Display available space (if known) | 200 | // Display available space |
201 | m_availSpace->setText( space ); | 201 | m_availSpace->setText( space ); |
202 | } | 202 | } |
203 | 203 | ||
204 | void InstallDlg::slotBtnStart() | 204 | void InstallDlg::slotBtnStart() |
205 | { | 205 | { |
206 | QString btnText = m_btnStart->text(); | 206 | QString btnText = m_btnStart->text(); |
207 | if ( btnText == tr( "Abort" ) ) | 207 | if ( btnText == tr( "Abort" ) ) |
208 | { | 208 | { |
209 | // Stop execution of current command and prevent any others from executing | 209 | // Stop execution of current command and prevent any others from executing |
210 | m_packman->abortCommand(); | 210 | m_packman->abortCommand(); |
211 | m_currCommand = 999; | 211 | m_currCommand = 999; |
212 | 212 | ||
213 | // Allow user to close dialog | 213 | // Allow user to close dialog |
214 | m_btnStart->setText( tr( "Close" ) ); | 214 | m_btnStart->setText( tr( "Close" ) ); |
215 | m_btnStart->setIconSet( Resource::loadPixmap( "enter" ) ); | 215 | m_btnStart->setIconSet( Resource::loadPixmap( "enter" ) ); |
216 | return; | 216 | return; |
217 | } | 217 | } |
218 | else if ( btnText == tr( "Close" ) ) | 218 | else if ( btnText == tr( "Close" ) ) |
219 | { | 219 | { |
220 | // TODO - force reload of package data | 220 | // TODO - force reload of package data |
221 | emit closeInstallDlg(); | 221 | emit closeInstallDlg(); |
222 | return; | 222 | return; |
223 | } | 223 | } |
224 | 224 | ||
225 | // Start was clicked, execute first command | 225 | // Start was clicked, execute first command |
226 | m_btnOptions->setEnabled( false ); | 226 | m_btnOptions->setEnabled( false ); |
227 | m_btnStart->setText( tr( "Abort" ) ); | 227 | m_btnStart->setText( tr( "Abort" ) ); |
228 | m_btnStart->setIconSet( Resource::loadPixmap( "close" ) ); | 228 | m_btnStart->setIconSet( Resource::loadPixmap( "close" ) ); |
229 | 229 | ||
230 | m_packman->executeCommand( m_command[ 0 ], m_packages[ 0 ], m_destination->currentText(), this, | 230 | QString dest; |
231 | if ( m_destination ) | ||
232 | dest = m_destination->currentText(); | ||
233 | m_packman->executeCommand( m_command[ 0 ], m_packages[ 0 ], dest, this, | ||
231 | SLOT(slotOutput(OProcess*,char*,int)), SLOT(slotErrors(OProcess*,char*,int)), | 234 | SLOT(slotOutput(OProcess*,char*,int)), SLOT(slotErrors(OProcess*,char*,int)), |
232 | SLOT(slotFinished(OProcess*)), true ); | 235 | SLOT(slotFinished(OProcess*)), true ); |
233 | } | 236 | } |
234 | 237 | ||
235 | void InstallDlg::slotBtnOptions() | 238 | void InstallDlg::slotBtnOptions() |
236 | { | 239 | { |
237 | QString btnText = m_btnOptions->text(); | 240 | QString btnText = m_btnOptions->text(); |
238 | if ( btnText == tr( "Options" ) ) | 241 | if ( btnText == tr( "Options" ) ) |
239 | { | 242 | { |
240 | // Display configuration dialog (only options tab is enabled) | 243 | // Display configuration dialog (only options tab is enabled) |
241 | m_packman->configureDlg( true ); | 244 | m_packman->configureDlg( true ); |
242 | return; | 245 | return; |
243 | } | 246 | } |
244 | 247 | ||
245 | // Save output was clicked | 248 | // Save output was clicked |
246 | QMap<QString, QStringList> map; | 249 | QMap<QString, QStringList> map; |
247 | map.insert( tr( "All" ), QStringList() ); | 250 | map.insert( tr( "All" ), QStringList() ); |
248 | QStringList text; | 251 | QStringList text; |
249 | text << "text/*"; | 252 | text << "text/*"; |
250 | map.insert(tr( "Text" ), text ); | 253 | map.insert(tr( "Text" ), text ); |
251 | text << "*"; | 254 | text << "*"; |
252 | map.insert( tr( "All" ), text ); | 255 | map.insert( tr( "All" ), text ); |
253 | 256 | ||
254 | QString filename = OFileDialog::getSaveFileName( 2, "/", "ipkg-output", map ); | 257 | QString filename = OFileDialog::getSaveFileName( 2, "/", "ipkg-output", map ); |
255 | if( !filename.isEmpty() ) | 258 | if( !filename.isEmpty() ) |
256 | { | 259 | { |
257 | QString currentFileName = QFileInfo( filename ).fileName(); | 260 | QString currentFileName = QFileInfo( filename ).fileName(); |
258 | DocLnk doc; | 261 | DocLnk doc; |
259 | doc.setType( "text/plain" ); | 262 | doc.setType( "text/plain" ); |
260 | doc.setFile( filename ); | 263 | doc.setFile( filename ); |
261 | doc.setName( currentFileName ); | 264 | doc.setName( currentFileName ); |
262 | FileManager fm; | 265 | FileManager fm; |
263 | fm.saveFile( doc, m_output->text() ); | 266 | fm.saveFile( doc, m_output->text() ); |
264 | } | 267 | } |
265 | } | 268 | } |
266 | 269 | ||
267 | void InstallDlg::slotOutput( OProcess */*process*/, char *buffer, int buffLen ) | 270 | void InstallDlg::slotOutput( OProcess */*process*/, char *buffer, int buffLen ) |
268 | { | 271 | { |
269 | QString lineStr = buffer; | 272 | QString lineStr = buffer; |
270 | if ( lineStr[buffLen-1] == '\n' ) | 273 | if ( lineStr[buffLen-1] == '\n' ) |
271 | lineStr.truncate( buffLen - 1 ); | 274 | lineStr.truncate( buffLen - 1 ); |
272 | m_output->append( lineStr ); | 275 | m_output->append( lineStr ); |
273 | m_output->setCursorPosition( m_output->numLines(), 0 ); | 276 | m_output->setCursorPosition( m_output->numLines(), 0 ); |
274 | } | 277 | } |
275 | 278 | ||
276 | void InstallDlg::slotErrors( OProcess */*process*/, char *buffer, int buffLen ) | 279 | void InstallDlg::slotErrors( OProcess */*process*/, char *buffer, int buffLen ) |
277 | { | 280 | { |
278 | QString lineStr = buffer; | 281 | QString lineStr = buffer; |