Commit 651bdb28 authored by Emmanuel Lepage's avatar Emmanuel Lepage

Dead code elimination 1/3

parent 8e9a351a
......@@ -22,25 +22,6 @@ CallView::CallView(ModelType type, QWidget* parent) : QTreeWidget(parent), TreeW
//User Interface events
connect(this, SIGNAL(itemDoubleClicked(QTreeWidgetItem*,int)), this, SLOT(itemDoubleClicked(QTreeWidgetItem*,int)));
connect(this, SIGNAL(itemClicked(QTreeWidgetItem*,int)), this, SLOT(itemClicked(QTreeWidgetItem*,int)));
//D-Bus event
// CallManagerInterface& callManager = CallManagerInterfaceSingleton::getInstance();
// connect(&callManager, SIGNAL(callStateChanged(const QString &, const QString &)),
// this, SLOT(callStateChangedSignal(const QString &, const QString &)));
// connect(&callManager, SIGNAL(incomingCall(const QString &, const QString &, const QString &)),
// this, SLOT(incomingCallSignal(const QString &, const QString &)));
// connect(&callManager, SIGNAL(conferenceCreated(const QString &)),
// this, SLOT(conferenceCreatedSignal(const QString &)));
// connect(&callManager, SIGNAL(conferenceChanged(const QString &, const QString &)),
// this, SLOT(conferenceChangedSignal(const QString &, const QString &)));
// connect(&callManager, SIGNAL(conferenceRemoved(const QString &)),
// this, SLOT(conferenceRemovedSignal(const QString &)));
// connect(&callManager, SIGNAL(incomingMessage(const QString &, const QString &)),
// this, SLOT(incomingMessageSignal(const QString &, const QString &)));
// connect(&callManager, SIGNAL(voiceMailNotify(const QString &, int)),
// this, SLOT(voiceMailNotifySignal(const QString &, int)));
}
......@@ -287,16 +268,8 @@ QMimeData* CallView::mimeData( const QList<QTreeWidgetItem *> items) const
///Add a call in the model structure, the call must exist before being added to the model
Call* CallView::addCall(Call* call, Call* parent)
{
//InternalCallModelStruct<CallTreeItem>* aNewStruct = privateCallList_call[CallModel<CallTreeItem>::addCall(call, parent)];
QTreeWidgetItem* callItem = new QTreeWidgetItem();
//aNewStruct->treeItem = callItem;
updateIndex(call,callItem);
//privateCallList_item[callItem] = aNewStruct;
//aNewStruct->call = ;
//privateCallList_widget[aNewStruct->call] = aNewStruct;
insertItem(callItem,parent);
setCurrentItem(callItem);
......@@ -399,11 +372,9 @@ CallTreeItem* CallView::insertItem(QTreeWidgetItem* item, QTreeWidgetItem* paren
else
parent->addChild(item);
//privateCallList_widget.remove(privateCallList_item[item]->call); //TODO needed?
CallTreeItem* callItem = new CallTreeItem();
updateWidget(getCall(item), callItem);
callItem->setCall(getCall(item));
//privateCallList_widget[privateCallList_item[item]->call] = privateCallList_item[item];
setItemWidget(item,0,callItem);
......@@ -473,23 +444,12 @@ Call* CallView::addConference(const QString & confID)
{
qDebug() << "Conference created";
Call* newConf = TreeWidgetCallModel::addConference(confID);
//InternalCallModelStruct<CallTreeItem>* aNewStruct = privateCallList_callId[confID];
// if (!aNewStruct) {
// qDebug() << "Conference failed";
// return 0;
// }
QTreeWidgetItem* confItem = new QTreeWidgetItem();
//aNewStruct->treeItem = confItem;
updateIndex(newConf,confItem);
//privateCallList_item[confItem] = aNewStruct;
//aNewStruct->call = ;
insertItem(confItem,(QTreeWidgetItem*)0);
//privateCallList_widget[aNewStruct->call] = aNewStruct;
setCurrentItem(confItem);
......@@ -553,31 +513,6 @@ void CallView::clearHistory()
historyCalls.clear();
}
// void CallView::callStateChangedSignal(const QString& callId, const QString& state)
// {
// qDebug() << "Signal : Call State Changed for call " << callId << " . New state : " << state;
// Call* call = findCallByCallId(callId);
// if(!call) {
// if(state == CALL_STATE_CHANGE_RINGING) {
// call = addRingingCall(callId);
// }
// else {
// qDebug() << "Call doesn't exist in this client. Might have been initialized by another client instance before this one started.";
// return;
// }
// }
// else {
// call->stateChanged(state);
// }
// }
//
// void CallView::incomingCallSignal(const QString& accountId, const QString& callId)
// {
// Q_UNUSED(accountId)
// qDebug() << "Signal : Incoming Call ! ID = " << callId;
// addIncomingCall(callId);
// }
//
void CallView::conferenceCreatedSignal(const QString& confId)
{
addConference(confId);
......
......@@ -176,15 +176,9 @@ void SFLPhone::setupActions()
action_screen = new QActionGroup(this);
action_screen->setExclusive(true);
action_main = new KAction(KIcon(QIcon(ICON_SCREEN_MAIN)), i18n("Main screen"), action_screen);
action_history = new KAction(KIcon(QIcon(ICON_SCREEN_HISTORY)), i18n("Call history"), action_screen);
action_addressBook = new KAction(KIcon(QIcon(ICON_SCREEN_ADDRESS)), i18n("Address book"), action_screen);
action_main->setCheckable(true);
action_history->setCheckable(true);
action_addressBook->setCheckable(true);
action_main->setChecked(true);
action_screen->addAction(action_main);
action_screen->addAction(action_history);
action_screen->addAction(action_addressBook);
action_close = KStandardAction::close(this, SLOT(close()), this);
action_quit = KStandardAction::quit(this, SLOT(quitButton()), this);
......@@ -213,8 +207,6 @@ void SFLPhone::setupActions()
connect(action_accountCreationWizard, SIGNAL(triggered()), m_pView, SLOT(accountCreationWizard()));
action_screen->addAction(action_main);
action_screen->addAction(action_history);
action_screen->addAction(action_addressBook);
actionCollection()->addAction("action_accept", action_accept);
actionCollection()->addAction("action_refuse", action_refuse);
......@@ -222,8 +214,6 @@ void SFLPhone::setupActions()
actionCollection()->addAction("action_transfer", action_transfer);
actionCollection()->addAction("action_record", action_record);
actionCollection()->addAction("action_main", action_main);
actionCollection()->addAction("action_history", action_history);
actionCollection()->addAction("action_addressBook", action_addressBook);
actionCollection()->addAction("action_mailBox", action_mailBox);
actionCollection()->addAction("action_close", action_close);
actionCollection()->addAction("action_quit", action_quit);
......@@ -348,16 +338,12 @@ void SFLPhone::on_m_pView_recordCheckStateChangeAsked(bool recordCheckState)
void SFLPhone::updateScreen(QAction * action)
{
if(action == action_main) m_pView->changeScreen(SCREEN_MAIN);
else if(action == action_history) m_pView->changeScreen(SCREEN_HISTORY);
else if(action == action_addressBook) m_pView->changeScreen(SCREEN_ADDRESS);
}
void SFLPhone::on_m_pView_screenChanged(int screen)
{
qDebug() << "on_m_pView_screenChanged";
if(screen == SCREEN_MAIN) action_main->setChecked(true);
else if(screen == SCREEN_HISTORY) action_history->setChecked(true);
else if(screen == SCREEN_ADDRESS) action_addressBook->setChecked(true);
}
QList<QAction*> SFLPhone::getCallActions()
......@@ -388,8 +374,3 @@ void SFLPhone::on_m_pView_incomingCall(const Call * call)
KNotification::event(KNotification::Notification, "New incomming call", "New call from: \n" + call->getPeerName().isEmpty() ? call->getPeerPhoneNumber() : call->getPeerName());
//}
}
void SFLPhone::on_m_pView_addressBookEnableAsked(bool enabled)
{
action_addressBook->setVisible(enabled);
}
......@@ -85,8 +85,6 @@ private:
KAction * action_record;
QActionGroup * action_screen;
KAction * action_main;
KAction * action_history;
KAction * action_addressBook;
KAction * action_mailBox;
KAction * action_close;
KAction * action_quit;
......@@ -140,7 +138,6 @@ private slots:
void on_m_pView_actionTextsChangeAsked(const QString * actionTexts);
void on_m_pView_transferCheckStateChangeAsked(bool transferCheckState);
void on_m_pView_recordCheckStateChangeAsked(bool recordCheckState);
void on_m_pView_addressBookEnableAsked(bool enabled);
void on_m_pView_screenChanged(int screen);
void on_m_pView_incomingCall(const Call * call);
......
This diff is collapsed.
......@@ -114,20 +114,14 @@ public:
*
* @return true if the address book is enabled in config
*/
bool isAddressBookEnabled();
//bool isAddressBookEnabled();
QVector<Contact *> findContactsInKAddressBook(QString textSearched, bool & full);
//QVector<Contact *> findContactsInKAddressBook(QString textSearched, bool & full);
/**
* Save the settings to save in the daemon before exit
*/
void saveState();
//CallTreeView *callTree;
//CallTreeView *historyTree;
//CallTreeView *addressBookTree;
//CallTreeWidget *callTree;
//CallTreeWidget *historyTree;
private slots:
/**
......@@ -193,26 +187,6 @@ private slots:
*/
void alternateColors(QListWidget * listWidget);
/**
* Adds the call's item to the call-list's listwidget.
* This function doesn't add anything to the callList object.
* @param call the call to add to the call-list's listwidget
*/
//Call* addCallToCallList(Call * call);
/**
* Adds the call's history-item to the call-history's listwidget.
* This function doesn't add anything to the callList object.
* @param call the past call to add to the call-history's listwidget
*/
//Call* addCallToCallHistory(Call * call);
/**
* Adds the contact's item to the addressbook's listwidget.
* @param contact the contact to add to the addressbook's listwidget
*/
void addContactToContactList(Contact * contact);
/**
* Updates the toolbar's actions' display according to the selected
* item's state.
......@@ -224,9 +198,6 @@ private slots:
* text searched.
* If empty, hide the search bar.
*/
void updateSearchHistory();
void updateCallHistory();
void updateAddressBook();
void updateRecordButton();
void updateVolumeButton();
void updateRecordBar();
......@@ -245,28 +216,6 @@ public slots:
void updateStatusMessage();
/**
* Enable the address book search line edit.
* To be called once the address book loading has finished.
*/
void enableAddressBook();
/**
* Loads the address book asynchronously.
* Calls enableAddressBook() once the address book
* loading has finished if it is not already loaded.
* @return true if address book has finished loading
*/
bool loadAddressBook();
/**
* Chooses to enable/disable (show/hide) the address book
* button according to the configuration's setting, and
* returns to the main window if is in address book
* whereas it is disabled.
*/
void updateAddressBookEnabled();
virtual void keyPressEvent(QKeyEvent *event)
{
......@@ -300,9 +249,6 @@ public slots:
void on_widget_dialpad_typed(QString text);
void on_lineEdit_searchHistory_textChanged();
void on_lineEdit_addressBook_textChanged();
void on_slider_recVol_valueChanged(int value);
void on_slider_sndVol_valueChanged(int value);
......@@ -312,12 +258,6 @@ public slots:
void on_callTree_currentItemChanged();
void on_callTree_itemChanged();
void on_callTree_itemDoubleClicked(QTreeWidgetItem* item, int column);
void on_listWidget_callHistory_currentItemChanged();
void on_listWidget_callHistory_itemDoubleClicked(Call* item);
void on_listWidget_addressBook_currentItemChanged();
void on_listWidget_addressBook_itemDoubleClicked(CallTreeItem * item);
void on_stackedWidget_screen_currentChanged(int index);
......
......@@ -393,22 +393,6 @@ void DlgAccounts::changedAccountList()
qDebug() << "changedAccountList";
accountListHasChanged = true;
emit updateButtons();
//toolButton_accountsApply->setEnabled(true);
//<<<<<<< HEAD
// int currentIndex = edit2_protocol->currentIndex();
// if(currentIndex==0)
// {
// tab_advanced->setEnabled(true);
// line_stun->setEnabled(checkbox_stun->isChecked());
// }
// else
// {
// tab_advanced->setEnabled(false);
// }
//=======
//>>>>>>> master
}
......@@ -476,22 +460,6 @@ void DlgAccounts::on_button_accountRemove_clicked()
listWidget_accountList->setCurrentRow( (r >= listWidget_accountList->count()) ? r-1 : r );
}
//<<<<<<< HEAD
/*void DlgAccounts::on_toolButton_accountsApply_clicked()
{
qDebug() << "on_toolButton_accountsApply_clicked";
updateSettings();
updateWidgets();
}*/
//=======
// void DlgAccounts::on_toolButton_accountsApply_clicked() //This button have been removed, coded kept for potential reversal
// {
// qDebug() << "on_toolButton_accountsApply_clicked";
// updateSettings();
// updateWidgets();
// }
//>>>>>>> master
void DlgAccounts::on_edit1_alias_textChanged(const QString & text)
{
qDebug() << "on_edit1_alias_textChanged";
......@@ -562,7 +530,7 @@ void DlgAccounts::updateSettings()
qDebug() << "DlgAccounts::updateSettings";
if(accountListHasChanged) {
saveAccountList();
//toolButton_accountsApply->setEnabled(false);
toolButton_accountsApply->setEnabled(false);
accountListHasChanged = false;
}
}
......@@ -571,7 +539,7 @@ void DlgAccounts::updateWidgets()
{
qDebug() << "DlgAccounts::updateWidgets";
loadAccountList();
//toolButton_accountsApply->setEnabled(false);
toolButton_accountsApply->setEnabled(false);
accountListHasChanged = false;
}
......
......@@ -73,29 +73,6 @@ void AccountList::updateAccounts()
emit accountListUpdated();
}
//void AccountList::upAccount(int index)
//{
// if(index <= 0 || index >= size()) {
// qDebug() << "Error : index or future index out of range in upAccount.";
// return;
// }
// Account* account = getAccountAt(index);
// accounts->remove(index);
// accounts->insert(index - 1, account);
//}
//void AccountList::downAccount(int index)
//{
// if(index < 0 || index >= size() - 1) {
// qDebug() << "Error : index or future index out of range in upAccount.";
// return;
// }
// Account* account = getAccountAt(index);
// accounts->remove(index);
// accounts->insert(index + 1, account);
//}
QString AccountList::getOrderedList() const
{
QString order;
......
......@@ -17,7 +17,7 @@
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
**************************************************************************/
#include "Call.h"
#include "CallModel.h"
......@@ -94,46 +94,6 @@ const function Call::stateChangedFunctionMap[11][6] =
const char * Call::historyIcons[3] = {ICON_HISTORY_INCOMING, ICON_HISTORY_OUTGOING, ICON_HISTORY_MISSED};
/*void Call::initCallItemWidget()
{
itemWidget = new QWidget();
labelIcon = new QLabel();
labelCallNumber = new QLabel(peerPhoneNumber);
labelTransferPrefix = new QLabel(i18n("Transfer to : "));
labelTransferNumber = new QLabel();
QSpacerItem * horizontalSpacer = new QSpacerItem(16777215, 20, QSizePolicy::Preferred, QSizePolicy::Minimum);
QHBoxLayout * mainLayout = new QHBoxLayout();
mainLayout->setContentsMargins ( 3, 1, 2, 1);
mainLayout->setSpacing(4);
QVBoxLayout * descr = new QVBoxLayout();
descr->setMargin(1);
descr->setSpacing(1);
QHBoxLayout * transfer = new QHBoxLayout();
transfer->setMargin(0);
transfer->setSpacing(0);
mainLayout->addWidget(labelIcon);
if(! peerName.isEmpty())
{
labelPeerName = new QLabel(peerName);
descr->addWidget(labelPeerName);
}
descr->addWidget(labelCallNumber);
transfer->addWidget(labelTransferPrefix);
transfer->addWidget(labelTransferNumber);
descr->addLayout(transfer);
mainLayout->addLayout(descr);
mainLayout->addItem(horizontalSpacer);
itemWidget->setLayout(mainLayout);
}*/
/*void Call::setItemIcon(const QString pixmap)
{
labelIcon->setPixmap(QPixmap(pixmap));
}*/
Call::Call(call_state startState, QString callId, QString peerName, QString peerNumber, QString account)
: conference(false)
{
......@@ -304,11 +264,6 @@ daemon_call_state Call::toDaemonCallState(const QString & stateName)
return DAEMON_CALL_STATE_FAILURE;
}
/*QWidget * Call::getItemWidget()
{
return itemWidget;
}*/
QString Call::getStopTimeStamp() const
{
if (stopTime == NULL)
......@@ -343,41 +298,6 @@ void Call::setCallNumber(QString number)
callNumber = number;
emit changed();
}
/*QWidget * Call::getHistoryItemWidget()
{
historyItemWidget = new QWidget();
labelHistoryIcon = new QLabel();
labelHistoryIcon->setPixmap(QPixmap(historyIcons[historyState]));
labelHistoryCallNumber = new QLabel(peerPhoneNumber);
if(startTime)
labelHistoryTime = new QLabel(startTime->toString(Qt::LocaleDate));
else
labelHistoryTime = new QLabel();
QSpacerItem * horizontalSpacer = new QSpacerItem(16777215, 20, QSizePolicy::Preferred, QSizePolicy::Minimum);
QHBoxLayout * mainLayout = new QHBoxLayout();
mainLayout->setContentsMargins ( 3, 1, 2, 1);
mainLayout->setSpacing(4);
QVBoxLayout * descr = new QVBoxLayout();
descr->setMargin(1);
descr->setSpacing(1);
descr->setMargin(0);
descr->setSpacing(1);
mainLayout->addWidget(labelHistoryIcon);
if(! peerName.isEmpty())
{
labelHistoryPeerName = new QLabel(peerName);
descr->addWidget(labelHistoryPeerName);
}
descr->addWidget(labelHistoryCallNumber);
descr->addWidget(labelHistoryTime);
mainLayout->addLayout(descr);
mainLayout->addItem(horizontalSpacer);
historyItemWidget->setLayout(mainLayout);
return historyItemWidget;
}*/
call_state Call::getState() const
{
......@@ -548,7 +468,7 @@ void Call::call()
callManager.placeCall(account, callId, callNumber);
this->account = account;
this->peerPhoneNumber = callNumber;
// Contact * contact = findContactForNumberInKAddressBook(peerPhoneNumber);
// Contact * contact = findContactForNumberInKAddressBook(peerPhoneNumber); //TODO port
// if(contact) this->peerName = contact->getNickName();
this->startTime = new QDateTime(QDateTime::currentDateTime());
this->historyState = OUTGOING;
......
......@@ -7,8 +7,6 @@ template <typename CallWidget, typename Index> bool CallModel<CallWidget,Index>
template <typename CallWidget, typename Index> QHash<QString, Call*> CallModel<CallWidget,Index>::activeCalls;
template <typename CallWidget, typename Index> QHash<QString, Call*> CallModel<CallWidget,Index>::historyCalls;
// template <typename CallWidget, typename Index> QHash<Call*, InternalCallModelStruct* > CallModel<CallWidget,Index>::privateCallList_call;
// template <typename CallWidget, typename Index> QHash<QString, InternalCallModelStruct* > CallModel<CallWidget,Index>::privateCallList_callId;/*
template <typename CallWidget, typename Index> typename CallModel<CallWidget,Index>::InternalCall CallModel<CallWidget,Index>::privateCallList_call;
template <typename CallWidget, typename Index> typename CallModel<CallWidget,Index>::InternalCallId CallModel<CallWidget,Index>::privateCallList_callId;
template <typename CallWidget, typename Index> typename CallModel<CallWidget,Index>::InternalIndex CallModel<CallWidget,Index>::privateCallList_index;
......@@ -90,12 +88,6 @@ template<typename CallWidget, typename Index> bool CallModel<CallWidget,Index>::
historyCalls[time_start] = Call::buildHistoryCall(callID, time_start.toUInt(), time_stop.toUInt(), accountID, peer_name, peer_number, history_state);
addCall(historyCalls[time_start]);
}
// QString type2 = param[0];
// QString number = param[1];
// QString name = param[2];
// uint stopTimeStamp = param[3].toUInt();
// QString account = param[4];
}
}
historyInit = true;
......
......@@ -27,19 +27,6 @@
Contact::Contact()
{
// this->firstName = addressee.name();
// this->secondName = addressee.familyName();
// this->nickName = addressee.nickName();
// this->phoneNumber = number.number();
// this->type = number.type();
// this->displayPhoto = displayPhoto;
// if(displayPhoto) {
// this->photo = new Picture(addressee.photo());
// }
// else {
// this->photo = NULL;
// }
initItem();
}
......
......@@ -23,7 +23,7 @@
</sizepolicy>
</property>
<property name="currentIndex">
<number>2</number>
<number>1</number>
</property>
<widget class="QWidget" name="page_callList">
<property name="sizePolicy">
......@@ -41,18 +41,7 @@
<verstretch>0</verstretch>
</sizepolicy>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QListWidget" name="listWidget_callHistory"/>
</item>
<item>
<widget class="KLineEdit" name="lineEdit_searchHistory">
<property name="showClearButton" stdset="0">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
<layout class="QVBoxLayout" name="verticalLayout_2"/>
</widget>
<widget class="QWidget" name="page_addressBook">
<property name="sizePolicy">
......@@ -61,34 +50,7 @@
<verstretch>0</verstretch>
</sizepolicy>
</property>
<layout class="QVBoxLayout" name="verticalLayout_5">
<item>
<widget class="QListWidget" name="listWidget_addressBook"/>
</item>
<item>
<widget class="KLineEdit" name="lineEdit_addressBook">
<property name="enabled">
<bool>true</bool>
</property>
<property name="text">
<string/>
</property>
<property name="showClearButton" stdset="0">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_addressBookFull">
<property name="text">
<string>Attention:number of results exceeds max displayed.</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
<layout class="QVBoxLayout" name="verticalLayout_5"/>
</widget>
</widget>
</item>
......@@ -231,11 +193,6 @@
</layout>
</widget>
<customwidgets>
<customwidget>
<class>KLineEdit</class>
<extends>QLineEdit</extends>
<header>klineedit.h</header>
</customwidget>
<customwidget>
<class>Dialpad</class>
<extends>QWidget</extends>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment