aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/kvirc/sparser/kvi_sp_literal.cpp24
-rw-r--r--src/kvirc/ui/kvi_channel.cpp36
-rw-r--r--src/kvirc/ui/kvi_channel.h17
-rw-r--r--src/kvirc/ui/kvi_maskeditor.cpp36
-rw-r--r--src/kvirc/ui/kvi_maskeditor.h1
-rw-r--r--src/kvirc/ui/kvi_modeeditor.cpp81
-rw-r--r--src/kvirc/ui/kvi_modeeditor.h3
-rw-r--r--src/modules/sharedfileswindow/sharedfileswindow.cpp9
8 files changed, 123 insertions, 84 deletions
diff --git a/src/kvirc/sparser/kvi_sp_literal.cpp b/src/kvirc/sparser/kvi_sp_literal.cpp
index 5bd40626a..289ad563f 100644
--- a/src/kvirc/sparser/kvi_sp_literal.cpp
+++ b/src/kvirc/sparser/kvi_sp_literal.cpp
@@ -243,7 +243,7 @@ void KviServerParser::parseLiteralJoin(KviIrcMessage *msg)
// FIXME: #warning "IF VERBOSE SAY THAT WE'RE REQUESTING MODES & BAN LIST" (Synching channel)
msg->connection()->requestQueue()->enqueueChannel(chan);
-
+
} else {
// This must be someone else...(or desync)
int iFlags = 0;
@@ -923,7 +923,7 @@ void KviServerParser::parseLiteralPrivmsg(KviIrcMessage *msg)
g_pApp->notifierMessage(query,KVI_SMALLICON_QUERYPRIVMSG,szMsg,KVI_OPTION_UINT(KviOption_uintNotifierAutoHideTime));
}
}
-
+
// if the message is identified (identify-msg CAP) then re-add the +/- char at the beginning
if(eCapState != IdentifyMsgCapNotUsed)
szMsgText = QString::fromAscii("%1%2").arg(eCapState == IdentifyMsgCapUsedIdentified ? "+" : "-").arg(szMsgText);
@@ -1420,7 +1420,7 @@ void KviServerParser::parseLiteralTopic(KviIrcMessage *msg)
chan->topicWidget()->setTopic(szTopic);
chan->topicWidget()->setTopicSetBy(szNick);
-
+
QString szTmp;
QDateTime date = QDateTime::currentDateTime();
switch(KVI_OPTION_UINT(KviOption_uintOutputDatetimeFormat))
@@ -1846,8 +1846,8 @@ void KviServerParser::parseChannelMode(const QString &szNick,const QString &szUs
if(msg->connection()->serverInfo()->isSupportedModeFlag(__modechar)) \
{ \
aParam = msg->connection()->decodeText(msg->safeParam(curParam++)); \
- chan->__chanfunc(aParam,bSet); \
bIsMe = IS_ME(msg,aParam); \
+ chan->__chanfunc(aParam,bSet,bIsMe); \
if(bIsMe) \
{ \
if(KVS_TRIGGER_EVENT_3_HALTED(bSet ? __evmeset : __evmeunset,chan,szNick,szUser,szHost))msg->setHaltOutput(); \
@@ -1894,7 +1894,7 @@ void KviServerParser::parseChannelMode(const QString &szNick,const QString &szUs
// (ircq) unrealircd's channel owner (channel mode q with nickname)
// (ircq) unrealircd's channel admin (channel mode a with nickname)
// not existing but supported mode (channel mode a with mask)
-
+
aParam = msg->connection()->decodeText(msg->safeParam(curParam++));
// we call setMask anyway to fill the "mode q editor"
chan->setMask(*aux,aParam,bSet,msg->connection()->decodeText(msg->safePrefix()),QDateTime::currentDateTime().toTime_t());
@@ -2138,10 +2138,10 @@ void KviServerParser::parseLiteralCap(KviIrcMessage *msg)
{
// :prefix CAP <nickname> LS [*] :<cap1> <cap2> <cap3> ....
// All but the last LS messages have the asterisk
-
+
QString szAsterisk = msg->connection()->decodeText(msg->safeParam(2));
bool bLast = szAsterisk != "*";
-
+
msg->connection()->serverInfo()->addSupportedCaps(szProtocols);
if(msg->connection()->stateData()->isInsideInitialCapLs())
@@ -2163,7 +2163,7 @@ void KviServerParser::parseLiteralCap(KviIrcMessage *msg)
{
// :prefix CAP <nickname> ACK [*] :<cap1> <cap2> <cap3> ....
// All but the last ACK messages have the asterisk
-
+
msg->connection()->serverInfo()->addSupportedCaps(szProtocols);
msg->connection()->stateData()->changeEnabledCapList(szProtocols);
@@ -2180,10 +2180,10 @@ void KviServerParser::parseLiteralCap(KviIrcMessage *msg)
if(!msg->haltOutput())
msg->console()->output(KVI_OUT_CAP,__tr2qs("Capability change acknowledged: %Q"),&szProtocols);
-
+
return;
}
-
+
if(szCmd == "NAK")
{
// :prefix CAP <nickname> NAK :<cap1> <cap2> <cap3> ....
@@ -2200,7 +2200,7 @@ void KviServerParser::parseLiteralCap(KviIrcMessage *msg)
return;
}
-
+
if(szCmd == "LIST")
{
// :prefix CAP <nickname> LIST [*] :<cap1> <cap2> <cap3> ....
@@ -2213,7 +2213,7 @@ void KviServerParser::parseLiteralCap(KviIrcMessage *msg)
return;
}
-
+
if(!msg->haltOutput())
msg->console()->output(KVI_OUT_CAP,__tr2qs("Received unknown extended capability message: %Q %Q"),&szCmd,&szProtocols);
}
diff --git a/src/kvirc/ui/kvi_channel.cpp b/src/kvirc/ui/kvi_channel.cpp
index ea7e50bac..abd126e78 100644
--- a/src/kvirc/ui/kvi_channel.cpp
+++ b/src/kvirc/ui/kvi_channel.cpp
@@ -127,7 +127,7 @@ KviChannel::KviChannel(KviFrame * lpFrm, KviConsole * lpConsole, const QString &
m_pSplitter = new KviTalSplitter(Qt::Horizontal,this);
m_pSplitter->setObjectName(szName);
m_pSplitter->setChildrenCollapsible(false);
-
+
// Spitted vertially on the left
m_pVertSplitter = new KviTalSplitter(Qt::Vertical,m_pSplitter);
m_pVertSplitter->setChildrenCollapsible(false);
@@ -156,7 +156,7 @@ KviChannel::KviChannel(KviFrame * lpFrm, KviConsole * lpConsole, const QString &
KviIrcConnectionServerInfo * pServerInfo = serverInfo();
// bans are hardcoded
cMode='b';
-
+
if(pServerInfo)
szDescription = pServerInfo->getChannelModeDescription(cMode);
if(szDescription.isEmpty())
@@ -165,14 +165,14 @@ KviChannel::KviChannel(KviFrame * lpFrm, KviConsole * lpConsole, const QString &
pButton = new KviWindowToolPageButton(KVI_SMALLICON_UNBAN,KVI_SMALLICON_BAN,szDescription,buttonContainer(),false,"ban_editor_button");
connect(pButton,SIGNAL(clicked()),this,SLOT(toggleListModeEditor()));
m_pListEditorButtons.insert(cMode, pButton);
-
+
//other list modes (dynamic)
QString szListModes = "";
if(pServerInfo)
{
szListModes = pServerInfo->supportedListModes();
szListModes.remove('b');
-
+
for(int i=0;i<szListModes.size();++i)
{
char cMode = szListModes.at(i).unicode();
@@ -204,7 +204,7 @@ KviChannel::KviChannel(KviFrame * lpFrm, KviConsole * lpConsole, const QString &
iIconOff = KVI_SMALLICON_BAN;
break;
}
-
+
pButton = new KviWindowToolPageButton(iIconOn,iIconOff,szDescription,buttonContainer(),false,"list_mode_editor_button");
connect(pButton,SIGNAL(clicked()),this,SLOT(toggleListModeEditor()));
m_pListEditorButtons.insert(cMode, pButton);
@@ -258,14 +258,14 @@ KviChannel::~KviChannel()
if(connection())
connection()->unregisterChannel(this);
}
-
+
// Then remove all the users and free mem
m_pUserListView->enableUpdates(false);
m_pUserListView->partAll();
delete m_pActionHistory;
delete m_pTmpHighLighted;
-
+
qDeleteAll(m_pListEditors);
m_pListEditors.clear();
qDeleteAll(m_pListEditorButtons);
@@ -510,7 +510,7 @@ void KviChannel::toggleListModeEditor()
char cMode=0;
QMap<char, KviWindowToolPageButton*>::const_iterator iter = m_pListEditorButtons.constBegin();
-
+
while (iter != m_pListEditorButtons.constEnd())
{
if(iter.value()==pButton)
@@ -520,7 +520,7 @@ void KviChannel::toggleListModeEditor()
}
++iter;
}
-
+
if(!cMode)
return; //wtf?
@@ -649,7 +649,7 @@ void KviChannel::setChannelModeWithParam(char cMode, QString & szParam)
{
if(szParam.isEmpty())
m_szChannelParameterModes.remove(cMode);
- else
+ else
m_szChannelParameterModes.insert(cMode,szParam);
updateModeLabel();
updateCaption();
@@ -692,6 +692,14 @@ void KviChannel::getChannelModeStringWithEmbeddedParams(QString & szBuffer)
}
}
+bool KviChannel::setOp(const QString & szNick, bool bOp, bool bIsMe)
+{
+ bool bRet = m_pUserListView->setOp(szNick,bOp);
+ if(bIsMe)
+ emit opStatusChanged();
+ return bRet;
+}
+
void KviChannel::setDeadChan()
{
m_iStateFlags |= KVI_CHANNEL_STATE_DEADCHAN;
@@ -701,7 +709,7 @@ void KviChannel::setDeadChan()
m_pUserListView->partAll();
m_pUserListView->enableUpdates(true);
m_pUserListView->setUserDataBase(0);
-
+
//clear all mask editors
QMap<char, KviMaskEditor*>::const_iterator iter2 = m_pListEditors.constBegin();
while (iter2 != m_pListEditors.constEnd())
@@ -1676,7 +1684,7 @@ void KviChannel::setMask(char cMode, const QString & szMask, bool bAdd, const QS
if(!m_pModeLists.contains(cMode))
{
- // we want to remove an item but we don't have any list?
+ // we want to remove an item but we don't have any list?
if(!bAdd)
return;
// lazily insert it
@@ -1723,7 +1731,7 @@ void KviChannel::internalMask(const QString & szMask, bool bAdd, const QString &
//delete mask from the editor
if(*ppEd)
(*ppEd)->removeMask(e);
-
+
if(szChangeMask.isNull())
{
//delete mask
@@ -1789,7 +1797,7 @@ void KviChannel::checkChannelSync()
// check if we're in the on-join request queue list
if(connection()->requestQueue()->isQueued(this))
return;
-
+
// check if there's any request still runinng
if(m_szSentModeRequests.size() != 0)
return;
diff --git a/src/kvirc/ui/kvi_channel.h b/src/kvirc/ui/kvi_channel.h
index 935e9a313..a3b768aaf 100644
--- a/src/kvirc/ui/kvi_channel.h
+++ b/src/kvirc/ui/kvi_channel.h
@@ -545,7 +545,7 @@ public:
* \param bOp Whether to set or unset the mode on the user
* \return bool
*/
- bool setOp(const QString & szNick, bool bOp){ return m_pUserListView->setOp(szNick,bOp); };
+ bool setOp(const QString & szNick, bool bOp, bool bIsMe);
/**
* \brief Sets the half operator mode
@@ -553,7 +553,7 @@ public:
* \param bHalfOp Whether to set or unset the mode on the user
* \return bool
*/
- bool setHalfOp(const QString & szNick, bool bHalfOp){ return m_pUserListView->setHalfOp(szNick,bHalfOp); };
+ bool setHalfOp(const QString & szNick, bool bHalfOp, bool ){ return m_pUserListView->setHalfOp(szNick,bHalfOp); };
/**
* \brief Sets the voice mode
@@ -561,7 +561,7 @@ public:
* \param bVoice Whether to set or unset the mode on the user
* \return bool
*/
- bool setVoice(const QString & szNick, bool bVoice){ return m_pUserListView->setVoice(szNick,bVoice); };
+ bool setVoice(const QString & szNick, bool bVoice, bool ){ return m_pUserListView->setVoice(szNick,bVoice); };
/**
* \brief Sets the user operator mode
@@ -569,7 +569,7 @@ public:
* \param bUserOp Whether to set or unset the mode on the user
* \return bool
*/
- bool setUserOp(const QString & szNick, bool bUserOp){ return m_pUserListView->setUserOp(szNick,bUserOp); };
+ bool setUserOp(const QString & szNick, bool bUserOp, bool ){ return m_pUserListView->setUserOp(szNick,bUserOp); };
/**
* \brief Returns true if the user is a chan owner
@@ -876,7 +876,7 @@ public:
* \return QByteArray
*/
QByteArray loadLogFile(const QString & szFileName, bool bGzip);
-
+
/**
* \brief Gets the KviIrcConnectionServerInfo structure associated to the current connection
* \return KviIrcConnectionServerInfo*
@@ -1062,6 +1062,13 @@ private slots:
* \return void
*/
void toggleToolButtons();
+
+signals:
+ /**
+ * \brief Emitted when our op status change
+ * \return void
+ */
+ void opStatusChanged();
};
#endif //_KVI_CHANNEL_H_
diff --git a/src/kvirc/ui/kvi_maskeditor.cpp b/src/kvirc/ui/kvi_maskeditor.cpp
index 6fcd424a3..459c191a1 100644
--- a/src/kvirc/ui/kvi_maskeditor.cpp
+++ b/src/kvirc/ui/kvi_maskeditor.cpp
@@ -123,16 +123,7 @@ KviMaskEditor::KviMaskEditor(QWidget * par,KviChannel * pChannel,KviWindowToolPa
: KviWindowToolWidget(par,button)
{
setObjectName(name);
- bool isEnabled=1;
m_pChannel = pChannel;
- if(m_pChannel)
- {
- if(!( m_pChannel->isMeHalfOp() ||
- m_pChannel->isMeOp() ||
- m_pChannel->isMeChanOwner() ||
- m_pChannel->isMeChanAdmin() )
- ) isEnabled=0;
- }
setFocusPolicy(Qt::ClickFocus);
@@ -208,7 +199,7 @@ KviMaskEditor::KviMaskEditor(QWidget * par,KviChannel * pChannel,KviWindowToolPa
g->addWidget(m_pMaskBox,3,0,1,2);
m_pRemoveMask = new QPushButton(__tr2qs("Re&move"),this);
- m_pRemoveMask->setEnabled(isEnabled);
+
m_pRemoveMask->setFocusPolicy(Qt::ClickFocus);
m_pRemoveMask->setFocusProxy(this);
g->addWidget(m_pRemoveMask,4,1);
@@ -216,7 +207,6 @@ KviMaskEditor::KviMaskEditor(QWidget * par,KviChannel * pChannel,KviWindowToolPa
m_pRemoveMask->setIcon(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_DELETEITEM)));
m_pAddButton = new QPushButton(__tr2qs("&Add"),this);
- m_pAddButton->setEnabled(isEnabled);
g->addWidget(m_pAddButton,4,0);
connect(m_pAddButton,SIGNAL(clicked()),this,SLOT(addClicked()));
m_pAddButton->setIcon(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_NEWITEM)));
@@ -224,11 +214,35 @@ KviMaskEditor::KviMaskEditor(QWidget * par,KviChannel * pChannel,KviWindowToolPa
g->setColumnStretch(1,1);
for(KviMaskEntry * e = maskList->first();e;e = maskList->next()) addMask(e);
+
+ updateOpStatus();
+
+ if(m_pChannel)
+ connect(m_pChannel, SIGNAL(opStatusChanged()), this, SLOT(updateOpStatus()));
}
KviMaskEditor::~KviMaskEditor()
{
+}
+
+void KviMaskEditor::updateOpStatus()
+{
+ bool isEnabled=true;
+ if(m_pChannel)
+ {
+ if(!( m_pChannel->isMeHalfOp() ||
+ m_pChannel->isMeOp() ||
+ m_pChannel->isMeChanOwner() ||
+ m_pChannel->isMeChanAdmin() ||
+ m_pChannel->connection()->userInfo()->hasUserMode('o') ||
+ m_pChannel->connection()->userInfo()->hasUserMode('O'))
+ ) isEnabled=false;
+ }
+ if(m_pRemoveMask)
+ m_pRemoveMask->setEnabled(isEnabled);
+ if(m_pAddButton)
+ m_pAddButton->setEnabled(isEnabled);
}
void KviMaskEditor::searchTextChanged ( const QString & text)
diff --git a/src/kvirc/ui/kvi_maskeditor.h b/src/kvirc/ui/kvi_maskeditor.h
index cd986f57a..0ff9cb83e 100644
--- a/src/kvirc/ui/kvi_maskeditor.h
+++ b/src/kvirc/ui/kvi_maskeditor.h
@@ -116,6 +116,7 @@ protected slots:
void addClicked();
void itemDoubleClicked( QTreeWidgetItem *,int);
void searchTextChanged ( const QString & );
+ void updateOpStatus();
signals:
void removeMasks(KviMaskEditor *,KviPointerList<KviMaskEntry> *);
};
diff --git a/src/kvirc/ui/kvi_modeeditor.cpp b/src/kvirc/ui/kvi_modeeditor.cpp
index 738d2d2f5..d7c3c6679 100644
--- a/src/kvirc/ui/kvi_modeeditor.cpp
+++ b/src/kvirc/ui/kvi_modeeditor.cpp
@@ -45,18 +45,7 @@ KviModeEditor::KviModeEditor(QWidget * par,KviWindowToolPageButton* button,const
{
setObjectName(name);
m_pChannel = pChan;
- bool bIsEnabled = true;
- if(pChan)
- {
- if(!( pChan->isMeHalfOp() ||
- pChan->isMeOp() ||
- pChan->isMeChanOwner() ||
- pChan->isMeChanAdmin() ||
- pChan->connection()->userInfo()->hasUserMode('o') ||
- pChan->connection()->userInfo()->hasUserMode('O')
- ) ) bIsEnabled = false;
- }
-
+
QGridLayout *pMasterLayout = new QGridLayout(this);
setFocusPolicy(Qt::ClickFocus);
@@ -66,13 +55,13 @@ KviModeEditor::KviModeEditor(QWidget * par,KviWindowToolPageButton* button,const
pMasterLayout->addWidget(pScrollArea,0,0);
pMasterLayout->setRowStretch(1,1);
-
- QPushButton * b = new QPushButton(bIsEnabled ? __tr2qs("&Apply") : __tr2qs("Close"), this);
- pMasterLayout->addWidget(b,1,0);
- connect(b,SIGNAL(clicked()),this,SLOT(commit()));
+
+ m_pButton = new QPushButton("", this);
+ pMasterLayout->addWidget(m_pButton,1,0);
+ connect(m_pButton,SIGNAL(clicked()),this,SLOT(commit()));
QWidget * pBackground = new QWidget(pScrollArea->viewport());
-
+
QGridLayout *g = new QGridLayout(pBackground);
QLabel * l = new QLabel("",pBackground);
@@ -105,7 +94,6 @@ KviModeEditor::KviModeEditor(QWidget * par,KviWindowToolPageButton* button,const
KviQString::sprintf(szTmp,"%c: %Q",cMode, getModeDescription(cMode));
pCheckBox = new QCheckBox(szTmp,pBackground);
- pCheckBox->setEnabled(bIsEnabled);
m_pCheckBoxes.insert(cMode,pCheckBox);
if(pChan)
pCheckBox->setChecked(pChan->plainChannelMode().contains(cMode));
@@ -124,17 +112,15 @@ KviModeEditor::KviModeEditor(QWidget * par,KviWindowToolPageButton* button,const
KviQString::sprintf(szTmp,"%c: %Q",cMode, getModeDescription(cMode));
pCheckBox = new QCheckBox(szTmp,pBackground);
m_pCheckBoxes.insert(cMode,pCheckBox);
- pCheckBox->setEnabled(bIsEnabled);
iRow++;
g->addWidget(pCheckBox,iRow,0,1,3);
connect(pCheckBox,SIGNAL(toggled(bool)),this,SLOT(checkBoxToggled(bool)));
pLineEdit = new QLineEdit(pBackground);
m_pLineEdits.insert(cMode,pLineEdit);
- pLineEdit->setEnabled(bIsEnabled);
iRow++;
g->addWidget(pLineEdit,iRow,1,1,2);
-
+
if(pChan)
{
if(pChan->hasChannelMode(cMode))
@@ -176,7 +162,6 @@ KviModeEditor::KviModeEditor(QWidget * par,KviWindowToolPageButton* button,const
KviQString::sprintf(szTmp,"%c: %Q",cMode, getModeDescription(cMode));
pCheckBox = new QCheckBox(szTmp,pBackground);
- pCheckBox->setEnabled(bIsEnabled);
m_pCheckBoxes.insert(cMode,pCheckBox);
if(pChan)
pCheckBox->setChecked(pChan->plainChannelMode().contains(cMode));
@@ -203,17 +188,15 @@ KviModeEditor::KviModeEditor(QWidget * par,KviWindowToolPageButton* button,const
KviQString::sprintf(szTmp,"%c: %Q",cMode, getModeDescription(cMode));
pCheckBox = new QCheckBox(szTmp,pBackground);
m_pCheckBoxes.insert(cMode,pCheckBox);
- pCheckBox->setEnabled(bIsEnabled);
iRow++;
g->addWidget(pCheckBox,iRow,0,1,3);
connect(pCheckBox,SIGNAL(toggled(bool)),this,SLOT(checkBoxToggled(bool)));
pLineEdit = new QLineEdit(pBackground);
m_pLineEdits.insert(cMode,pLineEdit);
- pLineEdit->setEnabled(bIsEnabled);
iRow++;
g->addWidget(pLineEdit,iRow,1,1,2);
-
+
if(pChan->hasChannelMode(cMode))
{
pCheckBox->setChecked(true);
@@ -226,15 +209,41 @@ KviModeEditor::KviModeEditor(QWidget * par,KviWindowToolPageButton* button,const
g->setRowStretch(++iRow,1);
g->setColumnStretch(2,1);
pScrollArea->setWidget(pBackground);
+
+ updateOpStatus();
+
+ if(m_pChannel)
+ connect(m_pChannel, SIGNAL(opStatusChanged()), this, SLOT(updateOpStatus()));
}
KviModeEditor::~KviModeEditor()
{
- for(int i=0;i<m_pLineEdits.count();++i)
- delete m_pLineEdits.value(i);
+ qDeleteAll(m_pLineEdits);
+ qDeleteAll(m_pCheckBoxes);
+}
+
+void KviModeEditor::updateOpStatus()
+{
+ bool isEnabled=true;
+ if(m_pChannel)
+ {
+ if(!( m_pChannel->isMeHalfOp() ||
+ m_pChannel->isMeOp() ||
+ m_pChannel->isMeChanOwner() ||
+ m_pChannel->isMeChanAdmin() ||
+ m_pChannel->connection()->userInfo()->hasUserMode('o') ||
+ m_pChannel->connection()->userInfo()->hasUserMode('O'))
+ ) isEnabled=false;
+ }
- for(int i=0;i<m_pCheckBoxes.count();++i)
- delete m_pCheckBoxes.value(i);
+ if(m_pButton)
+ m_pButton->setText(isEnabled ? __tr2qs("&Apply") : __tr2qs("Close"));
+
+ foreach(QLineEdit* pLineEdit, m_pLineEdits)
+ pLineEdit->setEnabled(isEnabled);
+
+ foreach(QCheckBox* pCheckBox, m_pCheckBoxes)
+ pCheckBox->setEnabled(isEnabled);
}
void KviModeEditor::checkBoxToggled(bool bChecked)
@@ -242,15 +251,15 @@ void KviModeEditor::checkBoxToggled(bool bChecked)
// enable/disable the lineedit if any
if(!sender())
return;
-
+
QChar c = m_pCheckBoxes.key((QCheckBox *)sender());
if(c.isNull())
return;
-
+
QLineEdit * pLineEdit = m_pLineEdits.value(c.unicode());
if(!pLineEdit)
return;
-
+
pLineEdit->setEnabled(bChecked);
}
@@ -285,7 +294,7 @@ void KviModeEditor::commit()
if(pCheckBox->isChecked())
{
// mode is checked
- if(!m_pChannel->hasChannelMode(cMode) ||
+ if(!m_pChannel->hasChannelMode(cMode) ||
(pLineEdit->text().trimmed() != m_pChannel->channelModeParam(cMode)))
{
// mode was not checked before, or the parameter has changed
@@ -296,7 +305,7 @@ void KviModeEditor::commit()
if(m_pChannel->hasChannelMode(cMode))
{
// but it was checked before
-
+
// checks if this specific mode does not need a parameter when set
if(modeNeedsParameterOnlyWhenSet(cMode))
{
@@ -358,7 +367,7 @@ void KviModeEditor::commit()
szParameters.clear();
}
iModes=0;
-
+
emit setMode(szCommitModes);
}
}
@@ -388,7 +397,7 @@ void KviModeEditor::commit()
szParameters.clear();
}
iModes=0;
-
+
emit setMode(szCommitModes);
}
}
diff --git a/src/kvirc/ui/kvi_modeeditor.h b/src/kvirc/ui/kvi_modeeditor.h
index 4b9f12d06..4b7af2257 100644
--- a/src/kvirc/ui/kvi_modeeditor.h
+++ b/src/kvirc/ui/kvi_modeeditor.h
@@ -33,6 +33,7 @@
class QCheckBox;
class QLineEdit;
+class QPushButton;
class KviIrcConnectionServerInfo;
class KviChannel;
@@ -49,6 +50,7 @@ public:
~KviModeEditor();
protected: // fields
KviChannel * m_pChannel;
+ QPushButton * m_pButton;
QMap<char, QCheckBox *> m_pCheckBoxes;
QMap<char, QLineEdit *> m_pLineEdits;
protected:
@@ -60,6 +62,7 @@ signals:
protected slots:
void checkBoxToggled(bool bChecked);
void commit();
+ void updateOpStatus();
};
#endif //_KVI_MODEEDITOR_H_
diff --git a/src/modules/sharedfileswindow/sharedfileswindow.cpp b/src/modules/sharedfileswindow/sharedfileswindow.cpp
index 9397ddcbd..4ea3f7e52 100644
--- a/src/modules/sharedfileswindow/sharedfileswindow.cpp
+++ b/src/modules/sharedfileswindow/sharedfileswindow.cpp
@@ -305,9 +305,8 @@ void KviSharedFilesWindow::fillFileView()
while(KviSharedFileList * l = it.current())
{
for(KviSharedFile * o = l->first();o;o = l->next())
- {
- KviSharedFilesTreeWidgetItem * itm = new KviSharedFilesTreeWidgetItem(m_pTreeWidget,o);
- }
+ new KviSharedFilesTreeWidgetItem(m_pTreeWidget,o);
+
++it;
}
enableButtons();
@@ -315,7 +314,7 @@ void KviSharedFilesWindow::fillFileView()
void KviSharedFilesWindow::sharedFileAdded(KviSharedFile * f)
{
- KviSharedFilesTreeWidgetItem * it = new KviSharedFilesTreeWidgetItem(m_pTreeWidget,f);
+ new KviSharedFilesTreeWidgetItem(m_pTreeWidget,f);
enableButtons();
}
@@ -323,7 +322,6 @@ void KviSharedFilesWindow::sharedFileRemoved(KviSharedFile * f)
{
QTreeWidgetItem * it;
for (int i=0;i<m_pTreeWidget->topLevelItemCount();i++)
-// while(it)
{
it=(QTreeWidgetItem *) m_pTreeWidget->topLevelItem(i);
if(((KviSharedFilesTreeWidgetItem *)it)->readOnlySharedFilePointer() == f)
@@ -331,7 +329,6 @@ void KviSharedFilesWindow::sharedFileRemoved(KviSharedFile * f)
delete ((KviSharedFilesTreeWidgetItem *)it);
return;
}
- // it = it->nextSibling();
}
enableButtons();
}