From aba3106f8fb738de742af591aca579364eefee72 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Quentin?= <jquentin@jquentin-laptop-kub2.(none)> Date: Tue, 2 Jun 2009 13:41:23 -0400 Subject: [PATCH] [#1562] crashes when trying to change item of a call of state "OVER" [#1563] should display debug messages only if asked with --with-debug at compilation + changed copyright and author email address --- sflphone-client-kde/INSTALL | 9 ++- sflphone-client-kde/config.sh | 18 ++++-- .../data/sflphone-client-kdeui.rc | 17 ++++- sflphone-client-kde/src/AccountItemWidget.h | 2 +- sflphone-client-kde/src/AccountWizard.h | 2 +- .../src/ActionSetAccountFirst.h | 2 +- sflphone-client-kde/src/CMakeLists.txt | 16 ++++- sflphone-client-kde/src/Call.cpp | 63 ++++++++----------- sflphone-client-kde/src/Contact.h | 2 +- sflphone-client-kde/src/ContactItemWidget.h | 2 +- sflphone-client-kde/src/SFLPhone.cpp | 2 +- .../src/instance_interface_singleton.h | 2 +- sflphone-client-kde/src/main.cpp | 5 +- sflphone-client-kde/src/qrc/resources.qrc | 40 ------------ sflphone-client-kde/src/sflphone_const.h | 2 + sflphone-client-kde/src/sflphone_kdeview.h | 2 +- 16 files changed, 92 insertions(+), 94 deletions(-) diff --git a/sflphone-client-kde/INSTALL b/sflphone-client-kde/INSTALL index 3f34eb11f8..d53870cafa 100644 --- a/sflphone-client-kde/INSTALL +++ b/sflphone-client-kde/INSTALL @@ -52,4 +52,11 @@ You can change the prefix of the installation using: .config.sh --prefix="expected_prefix_directory" -By default, it is set to /usr. \ No newline at end of file +By default, it is set to /usr/local. + +****************************************************** + +You can enable debug messages using: + + .config.sh --with-debug + diff --git a/sflphone-client-kde/config.sh b/sflphone-client-kde/config.sh index b67afe8749..6bb5513475 100755 --- a/sflphone-client-kde/config.sh +++ b/sflphone-client-kde/config.sh @@ -20,14 +20,24 @@ cd build # if $prefix # then options=$@" -DCMAKE_INSTALL_PREFIX="$prefix_env -options=`echo $@ | sed "s/--prefix=/-DCMAKE_INSTALL_PREFIX=/g"` +# debug=`echo $@ | grep -q "debug"` + +options=`echo $@ | sed "s/--prefix=/-DCMAKE_INSTALL_PREFIX=/g" | sed "s/--with-debug//g"` + +if `echo $@ | grep -q "\--with-debug"` +then echo "Enable debug messages" +options="$options -DCMAKE_BUILD_TYPE=\"Debug\"" +else echo "Disable debug messages" +options="$options -DCMAKE_BUILD_TYPE=\"Release\"" +fi + +echo "Passing argument '$options' to cmake" autocmd cmake $options .. -echo $options echo "**********************************************" echo "Configuration done!" -echo "Run \`cd build\' to go to the build directory." -echo "Then run \`make\'to build the software." +echo "Run \`cd build' to go to the build directory." +echo "Then run \`make'to build the software." echo "**********************************************" diff --git a/sflphone-client-kde/data/sflphone-client-kdeui.rc b/sflphone-client-kde/data/sflphone-client-kdeui.rc index bbba5e5402..ac092044e6 100644 --- a/sflphone-client-kde/data/sflphone-client-kdeui.rc +++ b/sflphone-client-kde/data/sflphone-client-kdeui.rc @@ -1,11 +1,14 @@ <?xml version="1.0" encoding="UTF-8"?> -<gui name="tutorial3" +<!--<gui name="tutorial3" version="1" xmlns="http://www.kde.org/standards/kxmlgui/1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.kde.org/standards/kxmlgui/1.0 http://www.kde.org/standards/kxmlgui/1.0/kxmlgui.xsd" > + --> +<gui name="sflphone-client-kde" version="1"> + <MenuBar> <Menu name="Actions" > <text>Actions</text> @@ -37,4 +40,16 @@ </Menu> </MenuBar> + <!--<ToolBar name="mainToolBar" position="Top" noMerge="1" fullWidth="true" newline="true" > + <Action name="action_accept" /> + <Action name="action_refuse" /> + <Action name="action_hold" /> + <Action name="action_transfer" /> + <Action name="action_record" /> + <Separator /> + <Action name="action_history" /> + <Action name="action_addressBook" /> + <Separator /> + <Action name="action_mailBox" /> + </ToolBar> --> </gui> \ No newline at end of file diff --git a/sflphone-client-kde/src/AccountItemWidget.h b/sflphone-client-kde/src/AccountItemWidget.h index dacfa39b84..1c9c36c827 100644 --- a/sflphone-client-kde/src/AccountItemWidget.h +++ b/sflphone-client-kde/src/AccountItemWidget.h @@ -28,7 +28,7 @@ #include <kled.h> /** - @author Jérémy Quentin <jeremy.quentin@gmail.com> + @author Jérémy Quentin <jeremy.quentin@savoirfairelinux.com> */ class AccountItemWidget : public QWidget { diff --git a/sflphone-client-kde/src/AccountWizard.h b/sflphone-client-kde/src/AccountWizard.h index 0095856a18..afa7588db0 100644 --- a/sflphone-client-kde/src/AccountWizard.h +++ b/sflphone-client-kde/src/AccountWizard.h @@ -29,7 +29,7 @@ /** - @author Jérémy Quentin <jeremy.quentin@gmail.com> + @author Jérémy Quentin <jeremy.quentin@savoirfairelinux.com> */ class AccountWizard : public QWizard { diff --git a/sflphone-client-kde/src/ActionSetAccountFirst.h b/sflphone-client-kde/src/ActionSetAccountFirst.h index dd8914f474..4e832e0ae4 100644 --- a/sflphone-client-kde/src/ActionSetAccountFirst.h +++ b/sflphone-client-kde/src/ActionSetAccountFirst.h @@ -27,7 +27,7 @@ #include "Account.h" /** - @author Jérémy Quentin <jeremy.quentin@gmail.com> + @author Jérémy Quentin <jeremy.quentin@savoirfairelinux.com> */ class ActionSetAccountFirst : public QAction { diff --git a/sflphone-client-kde/src/CMakeLists.txt b/sflphone-client-kde/src/CMakeLists.txt index 21d47e600b..73894ff7da 100644 --- a/sflphone-client-kde/src/CMakeLists.txt +++ b/sflphone-client-kde/src/CMakeLists.txt @@ -1,11 +1,25 @@ + ADD_DEFINITIONS(${KDE4_DEFINITIONS} ${QT_DEFINITIONS} -fexceptions -DDATA_INSTALL_DIR="\\\"${DATA_INSTALL_DIR}\\\"" ) -SET ( KDE4_KABC_LIBS -lkabc ) +# add_definitions ( -DKDE_DEFAULT_DEBUG_AREA=9000 ) + +# kde4_set_debug_area( 1234 ) +# IF(DEFINED DEBUG_DISABLED) +# MESSAGE("NO DEBUG OUTPUT") +# ADD_DEFINITIONS( -DQT_NO_DEBUG_OUTPUT ) +# ENDIF(DEFINED DEBUG_DISABLED) +MESSAGE("CMAKE_BUILD_TYPE = ${CMAKE_BUILD_TYPE}") +IF(${CMAKE_BUILD_TYPE} MATCHES Release) +MESSAGE("NO DEBUG OUTPUT") +ADD_DEFINITIONS( -DQT_NO_DEBUG_OUTPUT ) +ENDIF(DEFINED DEBUG_DISABLED) + +SET ( KDE4_KABC_LIBS -lkabc ) SET( sflphone_client_kde_SRCS diff --git a/sflphone-client-kde/src/Call.cpp b/sflphone-client-kde/src/Call.cpp index 10c9aa2dd1..1b640e0ff9 100644 --- a/sflphone-client-kde/src/Call.cpp +++ b/sflphone-client-kde/src/Call.cpp @@ -68,17 +68,17 @@ const function Call::actionPerformedFunctionMap[11][5] = const call_state Call::stateChangedStateMap [11][6] = { // RINGING CURRENT BUSY HOLD HUNGUP FAILURE -/*INCOMING */ {CALL_STATE_INCOMING , CALL_STATE_CURRENT , CALL_STATE_BUSY , CALL_STATE_HOLD , CALL_STATE_OVER , CALL_STATE_FAILURE }, -/*RINGING */ {CALL_STATE_RINGING , CALL_STATE_CURRENT , CALL_STATE_BUSY , CALL_STATE_HOLD , CALL_STATE_OVER , CALL_STATE_FAILURE }, -/*CURRENT */ {CALL_STATE_CURRENT , CALL_STATE_CURRENT , CALL_STATE_BUSY , CALL_STATE_HOLD , CALL_STATE_OVER , CALL_STATE_FAILURE }, -/*DIALING */ {CALL_STATE_RINGING , CALL_STATE_CURRENT , CALL_STATE_BUSY , CALL_STATE_HOLD , CALL_STATE_OVER , CALL_STATE_FAILURE }, -/*HOLD */ {CALL_STATE_HOLD , CALL_STATE_CURRENT , CALL_STATE_BUSY , CALL_STATE_HOLD , CALL_STATE_OVER , CALL_STATE_FAILURE }, -/*FAILURE */ {CALL_STATE_FAILURE , CALL_STATE_FAILURE , CALL_STATE_BUSY , CALL_STATE_FAILURE , CALL_STATE_OVER , CALL_STATE_FAILURE }, -/*BUSY */ {CALL_STATE_BUSY , CALL_STATE_CURRENT , CALL_STATE_BUSY , CALL_STATE_BUSY , CALL_STATE_OVER , CALL_STATE_FAILURE }, -/*TRANSFER */ {CALL_STATE_TRANSFER , CALL_STATE_TRANSFER , CALL_STATE_BUSY , CALL_STATE_TRANSF_HOLD , CALL_STATE_OVER , CALL_STATE_FAILURE }, -/*TRANSF_HOLD */ {CALL_STATE_TRANSF_HOLD , CALL_STATE_TRANSFER , CALL_STATE_BUSY , CALL_STATE_TRANSF_HOLD , CALL_STATE_OVER , CALL_STATE_FAILURE }, -/*OVER */ {CALL_STATE_OVER , CALL_STATE_OVER , CALL_STATE_OVER , CALL_STATE_OVER , CALL_STATE_OVER , CALL_STATE_OVER }, -/*ERROR */ {CALL_STATE_ERROR , CALL_STATE_ERROR , CALL_STATE_ERROR , CALL_STATE_ERROR , CALL_STATE_ERROR , CALL_STATE_ERROR } +/*INCOMING */ {CALL_STATE_INCOMING , CALL_STATE_CURRENT , CALL_STATE_BUSY , CALL_STATE_HOLD , CALL_STATE_OVER , CALL_STATE_FAILURE }, +/*RINGING */ {CALL_STATE_RINGING , CALL_STATE_CURRENT , CALL_STATE_BUSY , CALL_STATE_HOLD , CALL_STATE_OVER , CALL_STATE_FAILURE }, +/*CURRENT */ {CALL_STATE_CURRENT , CALL_STATE_CURRENT , CALL_STATE_BUSY , CALL_STATE_HOLD , CALL_STATE_OVER , CALL_STATE_FAILURE }, +/*DIALING */ {CALL_STATE_RINGING , CALL_STATE_CURRENT , CALL_STATE_BUSY , CALL_STATE_HOLD , CALL_STATE_OVER , CALL_STATE_FAILURE }, +/*HOLD */ {CALL_STATE_HOLD , CALL_STATE_CURRENT , CALL_STATE_BUSY , CALL_STATE_HOLD , CALL_STATE_OVER , CALL_STATE_FAILURE }, +/*FAILURE */ {CALL_STATE_FAILURE , CALL_STATE_FAILURE , CALL_STATE_BUSY , CALL_STATE_FAILURE , CALL_STATE_OVER , CALL_STATE_FAILURE }, +/*BUSY */ {CALL_STATE_BUSY , CALL_STATE_CURRENT , CALL_STATE_BUSY , CALL_STATE_BUSY , CALL_STATE_OVER , CALL_STATE_FAILURE }, +/*TRANSFER */ {CALL_STATE_TRANSFER , CALL_STATE_TRANSFER , CALL_STATE_BUSY , CALL_STATE_TRANSF_HOLD , CALL_STATE_OVER , CALL_STATE_FAILURE }, +/*TRANSF_HOLD */ {CALL_STATE_TRANSF_HOLD , CALL_STATE_TRANSFER , CALL_STATE_BUSY , CALL_STATE_TRANSF_HOLD , CALL_STATE_OVER , CALL_STATE_FAILURE }, +/*OVER */ {CALL_STATE_OVER , CALL_STATE_OVER , CALL_STATE_OVER , CALL_STATE_OVER , CALL_STATE_OVER , CALL_STATE_OVER }, +/*ERROR */ {CALL_STATE_ERROR , CALL_STATE_ERROR , CALL_STATE_ERROR , CALL_STATE_ERROR , CALL_STATE_ERROR , CALL_STATE_ERROR } }; const function Call::stateChangedFunctionMap[11][6] = @@ -139,15 +139,6 @@ void Call::initCallItem() descr->addLayout(transfer); mainLayout->addLayout(descr); mainLayout->addItem(horizontalSpacer); - -// QGridLayout * mainLayout = new QGridLayout(itemWidget); -// mainLayout->setMargin(3); -// mainLayout->setSpacing(3); -// mainLayout->addWidget(labelIcon, 0, 0, 2, 1); -// mainLayout->addWidget(labelCallNumber, 0, 1, 1, 2); -// mainLayout->addWidget(labelTransferPrefix, 1, 1, 1, 1); -// mainLayout->addWidget(labelTransferNumber, 1, 2, 1, 2); -// mainLayout->addItem(horizontalSpacer, 0, 3, 1, 3); itemWidget->setLayout(mainLayout); } @@ -157,13 +148,6 @@ void Call::setItemIcon(const QString pixmap) labelIcon->setPixmap(QPixmap(pixmap)); } -// void Call::setPeerName(const QString peerName) -// { -// qDebug() << "setPeerName(" << peerName; -// this->peerName = peerName; -// if(!labelPeerName) labelPeerName = new QLabel(peerName + " : "); -// labelPeerName->setText(peerName + " : "); -// } Call::Call(call_state startState, QString callId, QString peerName, QString peerNumber, QString account) { @@ -619,17 +603,24 @@ void Call::changeCurrentState(call_state newState) void Call::updateItem() { - if(currentState == CALL_STATE_CURRENT && recording) - setItemIcon(ICON_CURRENT_REC); + if(currentState != CALL_STATE_OVER) + { + if(currentState == CALL_STATE_CURRENT && recording) + setItemIcon(ICON_CURRENT_REC); + else + { + QString str = QString(callStateIcons[currentState]); + setItemIcon(str); + } + bool transfer = currentState == CALL_STATE_TRANSFER || currentState == CALL_STATE_TRANSF_HOLD; + labelTransferPrefix->setVisible(transfer); + labelTransferNumber->setVisible(transfer); + if(!transfer) + labelTransferNumber->setText(""); + } else { - QString str = QString(callStateIcons[currentState]); - setItemIcon(str); + qDebug() << "Updating item of call of state OVER. Doing nothing."; } - bool transfer = currentState == CALL_STATE_TRANSFER || currentState == CALL_STATE_TRANSF_HOLD; - labelTransferPrefix->setVisible(transfer); - labelTransferNumber->setVisible(transfer); - if(!transfer) - labelTransferNumber->setText(""); } diff --git a/sflphone-client-kde/src/Contact.h b/sflphone-client-kde/src/Contact.h index 0d62657eab..383aaa688e 100644 --- a/sflphone-client-kde/src/Contact.h +++ b/sflphone-client-kde/src/Contact.h @@ -31,7 +31,7 @@ using namespace KABC; /** - @author Jérémy Quentin <jeremy.quentin@gmail.com> + @author Jérémy Quentin <jeremy.quentin@savoirfairelinux.com> */ class Contact{ private: diff --git a/sflphone-client-kde/src/ContactItemWidget.h b/sflphone-client-kde/src/ContactItemWidget.h index 491af56d96..a3d4e3d41e 100644 --- a/sflphone-client-kde/src/ContactItemWidget.h +++ b/sflphone-client-kde/src/ContactItemWidget.h @@ -26,7 +26,7 @@ #include "Contact.h" /** - @author Jérémy Quentin <jeremy.quentin@gmail.com> + @author Jérémy Quentin <jeremy.quentin@savoirfairelinux.com> */ class ContactItemWidget : public QWidget { diff --git a/sflphone-client-kde/src/SFLPhone.cpp b/sflphone-client-kde/src/SFLPhone.cpp index 7c9ac108d0..37a13c05aa 100644 --- a/sflphone-client-kde/src/SFLPhone.cpp +++ b/sflphone-client-kde/src/SFLPhone.cpp @@ -120,7 +120,7 @@ void SFLPhone::setupActions() toolbar->addAction(view->action_addressBook); toolbar->addSeparator(); toolbar->addAction(view->action_mailBox); - toolbar->setIconSize(QSize(24,24)); + toolbar->setIconSize(QSize(TOOLBAR_SIZE,TOOLBAR_SIZE)); trayIconMenu = new QMenu(this); diff --git a/sflphone-client-kde/src/instance_interface_singleton.h b/sflphone-client-kde/src/instance_interface_singleton.h index 25b25f2ec2..8868b4ff30 100644 --- a/sflphone-client-kde/src/instance_interface_singleton.h +++ b/sflphone-client-kde/src/instance_interface_singleton.h @@ -26,7 +26,7 @@ #include "instance_dbus_interface.h" /** - @author Jérémy Quentin <jeremy.quentin@gmail.com> + @author Jérémy Quentin <jeremy.quentin@savoirfairelinux.com> */ class InstanceInterfaceSingleton { diff --git a/sflphone-client-kde/src/main.cpp b/sflphone-client-kde/src/main.cpp index e968c54774..e26c620353 100644 --- a/sflphone-client-kde/src/main.cpp +++ b/sflphone-client-kde/src/main.cpp @@ -17,7 +17,6 @@ #include "sflphone_const.h" - static const char description[] = I18N_NOOP("A KDE 4 Client for SFLPhone"); static const char version[] = "0.9.5"; @@ -37,12 +36,12 @@ int main(int argc, char **argv) version, ki18n(description), KAboutData::License_GPL, - ki18n("(C) 2009 Jérémy Quentin"), + ki18n("(C) 2009 Savoir-faire Linux"), KLocalizedString(), 0, "jeremy.quentin@savoirfairelinux.com"); - about.addAuthor( ki18n("Jérémy Quentin"), KLocalizedString(), "jeremy.quentin@gmail.com" ); + about.addAuthor( ki18n("Jérémy Quentin"), KLocalizedString(), "jeremy.quentin@savoirfairelinux.com" ); KCmdLineArgs::init(argc, argv, &about); KCmdLineOptions options; //options.add("+[URL]", ki18n( "Document to open" )); diff --git a/sflphone-client-kde/src/qrc/resources.qrc b/sflphone-client-kde/src/qrc/resources.qrc index f80e0438fc..db22439d98 100644 --- a/sflphone-client-kde/src/qrc/resources.qrc +++ b/sflphone-client-kde/src/qrc/resources.qrc @@ -5,46 +5,6 @@ <file>../icons/x-office-address-book.png</file> <file>../icons/add.png</file> <file>../icons/remove.png</file> - <file>../icons/del_off.png</file> - <file>../icons/del_on.png</file> - <file>../icons/accept.svg</file> - <file>../icons/busy.svg</file> - <file>../icons/call.svg</file> - <file>../icons/current.svg</file> - <file>../icons/dial.svg</file> - <file>../icons/fail.svg</file> - <file>../icons/hang_up.svg</file> - <file>../icons/history2.svg</file> - <file>../icons/history.svg</file> - <file>../icons/hold.svg</file> - <file>../icons/icon_accept.svg</file> - <file>../icons/icon_call.svg</file> - <file>../icons/icon_dialpad_off.svg</file> - <file>../icons/icon_dialpad.svg</file> - <file>../icons/icon_hangup.svg</file> - <file>../icons/icon_hold.svg</file> - <file>../icons/icon_rec.svg</file> - <file>../icons/icon_unhold.svg</file> - <file>../icons/icon_volume_off.svg</file> - <file>../icons/icon_volume.svg</file> - <file>../icons/incoming.svg</file> - <file>../icons/mailbox.svg</file> - <file>../icons/mic_25.svg</file> - <file>../icons/mic_50.svg</file> - <file>../icons/mic_75.svg</file> - <file>../icons/mic.svg</file> - <file>../icons/missed.svg</file> - <file>../icons/outgoing.svg</file> - <file>../icons/rec_call.svg</file> - <file>../icons/refuse.svg</file> - <file>../icons/ring.svg</file> - <file>../icons/speaker_25.svg</file> - <file>../icons/speaker_50.svg</file> - <file>../icons/speaker_75.svg</file> - <file>../icons/speaker.svg</file> - <file>../icons/stock_person.svg</file> - <file>../icons/transfert.svg</file> - <file>../icons/unhold.svg</file> <file>../icons/accept.svg</file> <file>../icons/busy.svg</file> <file>../icons/call.svg</file> diff --git a/sflphone-client-kde/src/sflphone_const.h b/sflphone-client-kde/src/sflphone_const.h index 96a56c7603..9583eb776b 100644 --- a/sflphone-client-kde/src/sflphone_const.h +++ b/sflphone-client-kde/src/sflphone_const.h @@ -47,6 +47,8 @@ #define PAGE_ACCOUNTS 2 #define PAGE_AUDIO 3 +#define TOOLBAR_SIZE 22 + #define CONTACT_ITEM_HEIGHT 40 #define CONFIG_FILE_PATH "/.sflphone/sflphonedrc" diff --git a/sflphone-client-kde/src/sflphone_kdeview.h b/sflphone-client-kde/src/sflphone_kdeview.h index 20017b53fe..3d7fadab15 100644 --- a/sflphone-client-kde/src/sflphone_kdeview.h +++ b/sflphone-client-kde/src/sflphone_kdeview.h @@ -47,7 +47,7 @@ class ConfigurationDialog; * here. * * @short Main view - * @author Jérémy Quentin <jeremy.quentin@gmail.com> + * @author Jérémy Quentin <jeremy.quentin@savoirfairelinux.com> * @version 0.1 */ -- GitLab