author | erik <erik> | 2007-01-29 21:53:48 (UTC) |
---|---|---|
committer | erik <erik> | 2007-01-29 21:53:48 (UTC) |
commit | 02ef45be75a3024df11365956e1cce6392d9103c (patch) (unidiff) | |
tree | 42fd5c909d67a473f57a607e01d32e01b3dd2511 /noncore/apps/opie-console | |
parent | b2c306a99b8dc82c981390f02db859149fac8cf0 (diff) | |
download | opie-02ef45be75a3024df11365956e1cce6392d9103c.zip opie-02ef45be75a3024df11365956e1cce6392d9103c.tar.gz opie-02ef45be75a3024df11365956e1cce6392d9103c.tar.bz2 |
Each file in this commit has an issue where the initial value of a variable
is assumed to be something but no initial value is given.
This commit changes that by either assigning an initial value or removing
the assumption on an initial value (usually the former).
-rw-r--r-- | noncore/apps/opie-console/io_irda.cpp | 1 | ||||
-rw-r--r-- | noncore/apps/opie-console/mainwindow.cpp | 8 |
2 files changed, 3 insertions, 6 deletions
diff --git a/noncore/apps/opie-console/io_irda.cpp b/noncore/apps/opie-console/io_irda.cpp index 9d27c85..a0f72ae 100644 --- a/noncore/apps/opie-console/io_irda.cpp +++ b/noncore/apps/opie-console/io_irda.cpp | |||
@@ -14,48 +14,49 @@ IOIrda::~IOIrda() { | |||
14 | 14 | ||
15 | void IOIrda::close() { | 15 | void IOIrda::close() { |
16 | 16 | ||
17 | IOSerial::close(); | 17 | IOSerial::close(); |
18 | // still need error handling | 18 | // still need error handling |
19 | delete m_attach; | 19 | delete m_attach; |
20 | } | 20 | } |
21 | 21 | ||
22 | bool IOIrda::open() { | 22 | bool IOIrda::open() { |
23 | bool ret; | 23 | bool ret; |
24 | 24 | ||
25 | // irdaattach here | 25 | // irdaattach here |
26 | m_attach = new Opie::Core::OProcess(); | 26 | m_attach = new Opie::Core::OProcess(); |
27 | *m_attach << "irattach /dev/ttyS2 -s"; | 27 | *m_attach << "irattach /dev/ttyS2 -s"; |
28 | 28 | ||
29 | connect( m_attach, SIGNAL( processExited(Opie::Core::OProcess*) ), | 29 | connect( m_attach, SIGNAL( processExited(Opie::Core::OProcess*) ), |
30 | this, SLOT( slotExited(Opie::Core::OProcess*) ) ); | 30 | this, SLOT( slotExited(Opie::Core::OProcess*) ) ); |
31 | 31 | ||
32 | if ( m_attach->start() ) { | 32 | if ( m_attach->start() ) { |
33 | ret= IOSerial::open(); | 33 | ret= IOSerial::open(); |
34 | } else { | 34 | } else { |
35 | // emit error!!! | 35 | // emit error!!! |
36 | delete m_attach; | 36 | delete m_attach; |
37 | m_attach = 0l; | 37 | m_attach = 0l; |
38 | ret = false; | ||
38 | } | 39 | } |
39 | return ret; | 40 | return ret; |
40 | } | 41 | } |
41 | 42 | ||
42 | void IOIrda::reload( const Profile &config ) { | 43 | void IOIrda::reload( const Profile &config ) { |
43 | m_device = config.readEntry("Device", IRDA_DEFAULT_DEVICE); | 44 | m_device = config.readEntry("Device", IRDA_DEFAULT_DEVICE); |
44 | m_baud = config.readNumEntry("Baud", IRDA_DEFAULT_BAUD); | 45 | m_baud = config.readNumEntry("Baud", IRDA_DEFAULT_BAUD); |
45 | m_parity = config.readNumEntry("Parity", IRDA_DEFAULT_PARITY); | 46 | m_parity = config.readNumEntry("Parity", IRDA_DEFAULT_PARITY); |
46 | m_dbits = config.readNumEntry("DataBits", IRDA_DEFAULT_DBITS); | 47 | m_dbits = config.readNumEntry("DataBits", IRDA_DEFAULT_DBITS); |
47 | m_sbits = config.readNumEntry("StopBits", IRDA_DEFAULT_SBITS); | 48 | m_sbits = config.readNumEntry("StopBits", IRDA_DEFAULT_SBITS); |
48 | m_flow = config.readNumEntry("Flow", IRDA_DEFAULT_FLOW); | 49 | m_flow = config.readNumEntry("Flow", IRDA_DEFAULT_FLOW); |
49 | } | 50 | } |
50 | 51 | ||
51 | 52 | ||
52 | QString IOIrda::identifier() const { | 53 | QString IOIrda::identifier() const { |
53 | return "irda"; | 54 | return "irda"; |
54 | } | 55 | } |
55 | 56 | ||
56 | QString IOIrda::name() const { | 57 | QString IOIrda::name() const { |
57 | return "Irda IO Layer"; | 58 | return "Irda IO Layer"; |
58 | } | 59 | } |
59 | 60 | ||
60 | void IOIrda::slotExited(Opie::Core::OProcess* proc ){ | 61 | void IOIrda::slotExited(Opie::Core::OProcess* proc ){ |
61 | close(); | 62 | close(); |
diff --git a/noncore/apps/opie-console/mainwindow.cpp b/noncore/apps/opie-console/mainwindow.cpp index aba7244..a884179 100644 --- a/noncore/apps/opie-console/mainwindow.cpp +++ b/noncore/apps/opie-console/mainwindow.cpp | |||
@@ -686,57 +686,53 @@ void MainWindow::slotFullscreen() { | |||
686 | ( m_curSession->widgetStack() )->reparent( savedParentFullscreen, 0, QPoint(0,0), true ); | 686 | ( m_curSession->widgetStack() )->reparent( savedParentFullscreen, 0, QPoint(0,0), true ); |
687 | ( m_curSession->widgetStack() )->resize( savedParentFullscreen->width(), savedParentFullscreen->height() ); | 687 | ( m_curSession->widgetStack() )->resize( savedParentFullscreen->width(), savedParentFullscreen->height() ); |
688 | ( m_curSession->emulationHandler() )->cornerButton()->hide(); | 688 | ( m_curSession->emulationHandler() )->cornerButton()->hide(); |
689 | disconnect( ( m_curSession->emulationHandler() )->cornerButton(), SIGNAL( pressed() ), this, SLOT( slotFullscreen() ) ); | 689 | disconnect( ( m_curSession->emulationHandler() )->cornerButton(), SIGNAL( pressed() ), this, SLOT( slotFullscreen() ) ); |
690 | 690 | ||
691 | } else { | 691 | } else { |
692 | savedParentFullscreen = ( m_curSession->widgetStack() )->parentWidget(); | 692 | savedParentFullscreen = ( m_curSession->widgetStack() )->parentWidget(); |
693 | ( m_curSession->widgetStack() )->setFrameStyle( QFrame::NoFrame ); | 693 | ( m_curSession->widgetStack() )->setFrameStyle( QFrame::NoFrame ); |
694 | ( m_curSession->widgetStack() )->reparent( 0, WStyle_Tool | WStyle_Customize | WStyle_StaysOnTop | 694 | ( m_curSession->widgetStack() )->reparent( 0, WStyle_Tool | WStyle_Customize | WStyle_StaysOnTop |
695 | , QPoint(0,0), false ); | 695 | , QPoint(0,0), false ); |
696 | ( m_curSession->widgetStack() )->resize( qApp->desktop()->width(), qApp->desktop()->height() ); | 696 | ( m_curSession->widgetStack() )->resize( qApp->desktop()->width(), qApp->desktop()->height() ); |
697 | ( m_curSession->widgetStack() )->setFocus(); | 697 | ( m_curSession->widgetStack() )->setFocus(); |
698 | ( m_curSession->widgetStack() )->show(); | 698 | ( m_curSession->widgetStack() )->show(); |
699 | 699 | ||
700 | ( ( m_curSession->emulationHandler() )->cornerButton() )->show(); | 700 | ( ( m_curSession->emulationHandler() )->cornerButton() )->show(); |
701 | 701 | ||
702 | connect( ( m_curSession->emulationHandler() )->cornerButton(), SIGNAL( pressed() ), this, SLOT( slotFullscreen() ) ); | 702 | connect( ( m_curSession->emulationHandler() )->cornerButton(), SIGNAL( pressed() ), this, SLOT( slotFullscreen() ) ); |
703 | } | 703 | } |
704 | 704 | ||
705 | m_isFullscreen = !m_isFullscreen; | 705 | m_isFullscreen = !m_isFullscreen; |
706 | } | 706 | } |
707 | 707 | ||
708 | void MainWindow::slotScrollbarSelected(int index) | 708 | void MainWindow::slotScrollbarSelected(int index) |
709 | { | 709 | { |
710 | int loc; | 710 | int loc = 0; |
711 | 711 | ||
712 | Config cfg( "Konsole" ); | 712 | Config cfg( "Konsole" ); |
713 | cfg.setGroup("ScrollBar"); | 713 | cfg.setGroup("ScrollBar"); |
714 | if(index == sm_none) | 714 | if(index == sm_left) |
715 | { | ||
716 | loc = 0; | ||
717 | } | ||
718 | else if(index == sm_left) | ||
719 | { | 715 | { |
720 | loc = 1; | 716 | loc = 1; |
721 | } | 717 | } |
722 | else if(index == sm_right) | 718 | else if(index == sm_right) |
723 | { | 719 | { |
724 | loc = 2; | 720 | loc = 2; |
725 | } | 721 | } |
726 | 722 | ||
727 | cfg.writeEntry("Position", loc); | 723 | cfg.writeEntry("Position", loc); |
728 | 724 | ||
729 | if (currentSession()) { | 725 | if (currentSession()) { |
730 | currentSession()->emulationHandler()->setScrollbarLocation(loc); | 726 | currentSession()->emulationHandler()->setScrollbarLocation(loc); |
731 | } | 727 | } |
732 | 728 | ||
733 | m_scrollbar->setItemChecked(sm_none, index == sm_none); | 729 | m_scrollbar->setItemChecked(sm_none, index == sm_none); |
734 | m_scrollbar->setItemChecked(sm_left, index == sm_left); | 730 | m_scrollbar->setItemChecked(sm_left, index == sm_left); |
735 | m_scrollbar->setItemChecked(sm_right, index == sm_right); | 731 | m_scrollbar->setItemChecked(sm_right, index == sm_right); |
736 | } | 732 | } |
737 | 733 | ||
738 | void MainWindow::slotKeyReceived(FKey k, ushort, ushort, bool pressed) { | 734 | void MainWindow::slotKeyReceived(FKey k, ushort, ushort, bool pressed) { |
739 | 735 | ||
740 | if ( m_curSession ) { | 736 | if ( m_curSession ) { |
741 | 737 | ||
742 | QEvent::Type state; | 738 | QEvent::Type state; |