Преглед на файлове

Configurable time to wait for count reply after sending a message.

Mihawk преди 12 години
родител
ревизия
8614900b20
променени са 3 файла, в които са добавени 9 реда и са изтрити 2 реда
  1. 2 2
      ActiveClient.cpp
  2. 6 0
      Settings.cpp
  3. 1 0
      Settings.h

+ 2 - 2
ActiveClient.cpp

@@ -137,9 +137,9 @@ void ActiveClient::setReplyHash(const QString &hash)
 {
   myReplyHash = hash;
 
-  /* Wait for 5 seconds */
+  /* Wait for reply */
   myBroadcastReplyTimer->setSingleShot(true);
-  myBroadcastReplyTimer->start(5000);
+  myBroadcastReplyTimer->start(Settings::globalInstance()->timeToWaitForCountReply()*1000);
 }
 
 const QString& ActiveClient::replyHash() const

+ 6 - 0
Settings.cpp

@@ -123,6 +123,11 @@ int Settings::timeToSayHiAfterConnected() const
   return ourSettings->value("timeToSayHiAfterConnected", 7).toInt();
 }
 
+int Settings::timeToWaitForCountReply() const
+{
+  return ourSettings->value("timeToWaitForCountReply", 7).toInt();
+}
+
 void Settings::save()
 {
   ourSettings->setValue("quakeFolder", quakeFolder());
@@ -136,6 +141,7 @@ void Settings::save()
   ourSettings->setValue("qwFloodProtTime", qwFloodProtTime());
   ourSettings->setValue("spamFloodProtTime", spamFloodProtTime());
   ourSettings->setValue("timeToSayHiAfterConnected", timeToSayHiAfterConnected());
+  ourSettings->setValue("timeToWaitForCountReply", timeToWaitForCountReply());
 
   QStringList list = serverList();
   setServerList(list);

+ 1 - 0
Settings.h

@@ -43,6 +43,7 @@ public:
   int               spamFloodProtTime() const;
   unsigned int      queryInterval() const;
   int               timeToSayHiAfterConnected() const;
+  int               timeToWaitForCountReply() const;
 
   void              save();