summaryrefslogtreecommitdiff
authorskyhusker <skyhusker>2005-04-10 21:19:22 (UTC)
committer skyhusker <skyhusker>2005-04-10 21:19:22 (UTC)
commitd133e1f4c2b820ca428438cb17f5477190d268b1 (patch) (unidiff)
treeaa078c18de7bef76f37af9133f413f8bff478a1e
parenta6670730bf0b36b243303e581c4a80d29851c12b (diff)
downloadopie-d133e1f4c2b820ca428438cb17f5477190d268b1.zip
opie-d133e1f4c2b820ca428438cb17f5477190d268b1.tar.gz
opie-d133e1f4c2b820ca428438cb17f5477190d268b1.tar.bz2
Move to home directory on startup. Fixes bug #1614.
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--noncore/apps/opie-console/mainwindow.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/noncore/apps/opie-console/mainwindow.cpp b/noncore/apps/opie-console/mainwindow.cpp
index 21de5c0..eaa78c8 100644
--- a/noncore/apps/opie-console/mainwindow.cpp
+++ b/noncore/apps/opie-console/mainwindow.cpp
@@ -503,24 +503,29 @@ void MainWindow::slotClose() {
503 * We will get the name 503 * We will get the name
504 * Then the profile 504 * Then the profile
505 * and then we will make a profile 505 * and then we will make a profile
506 */ 506 */
507void MainWindow::slotProfile( int id) { 507void MainWindow::slotProfile( int id) {
508 Profile prof = manager()->profile( m_sessionsPop->text( id) ); 508 Profile prof = manager()->profile( m_sessionsPop->text( id) );
509 create( prof ); 509 create( prof );
510} 510}
511 511
512 512
513 513
514void MainWindow::create( const Profile& prof ) { 514void MainWindow::create( const Profile& prof ) {
515 char *homeDir = getenv("HOME");
516
517 if ( homeDir )
518 ::chdir( homeDir );
519
515 if(m_curSession) 520 if(m_curSession)
516 if(m_curSession->transferDialog()) m_curSession->transferDialog()->hide(); 521 if(m_curSession->transferDialog()) m_curSession->transferDialog()->hide();
517 522
518 Session *ses = manager()->fromProfile( prof, tabWidget() ); 523 Session *ses = manager()->fromProfile( prof, tabWidget() );
519 524
520 if((!ses) || (!ses->layer()) || (!ses->widgetStack())) 525 if((!ses) || (!ses->layer()) || (!ses->widgetStack()))
521 { 526 {
522 QMessageBox::warning(this, 527 QMessageBox::warning(this,
523 QObject::tr("Session failed"), 528 QObject::tr("Session failed"),
524 QObject::tr("<qt>Cannot open session: Not all components were found.</qt>")); 529 QObject::tr("<qt>Cannot open session: Not all components were found.</qt>"));
525 //if(ses) delete ses; 530 //if(ses) delete ses;
526 return; 531 return;