--- a/QTfrontend/ui/widget/SmartLineEdit.cpp Tue Oct 25 13:30:02 2011 +0400
+++ b/QTfrontend/ui/widget/SmartLineEdit.cpp Tue Oct 25 19:46:59 2011 +0200
@@ -53,61 +53,41 @@
void SmartLineEdit::addCommands(const QStringList & commands)
{
- m_keywordMutex.lock();
-
m_cmds->append(commands);
-
- m_keywordMutex.unlock();
}
void SmartLineEdit::removeCommands(const QStringList & commands)
{
- m_keywordMutex.lock();
-
foreach (const QString & cmd, commands)
{
m_cmds->removeAll(cmd);
}
-
- m_keywordMutex.unlock();
}
void SmartLineEdit::addNickname(const QString & name)
{
- m_keywordMutex.lock();
-
m_sorted_nicks->insert(name.toLower(), name);
m_nicks->append(name);
-
- m_keywordMutex.unlock();
}
void SmartLineEdit::removeNickname(const QString & name)
{
- m_keywordMutex.lock();
-
m_sorted_nicks->remove(name.toLower());
m_nicks->removeAll(name);
-
- m_keywordMutex.unlock();
}
void SmartLineEdit::reset()
{
// forget keywords
- m_keywordMutex.lock();
-
m_cmds->clear();
m_sorted_nicks->clear();
m_nicks->clear();
resetAutoCompletionStatus();
- m_keywordMutex.unlock();
-
// forget history
HistoryLineEdit::reset();
}
@@ -173,10 +153,8 @@
}
else
{
- m_keywordMutex.lock();
m_cmds->sort();
m_nicks = new QStringList(m_sorted_nicks->values());
- m_keywordMutex.unlock();
int cp = cursorPosition();
@@ -211,8 +189,6 @@
}
- m_keywordMutex.lock();
-
if (isFirstWord)
{
// find matching commands
@@ -250,8 +226,6 @@
}
}
- m_keywordMutex.unlock();
-
// we found a single match?
if (!match.isEmpty())
{