diff options
| author | 2016-08-12 02:45:10 -0400 | |
|---|---|---|
| committer | 2016-08-12 02:45:10 -0400 | |
| commit | e3306538d085d284006d3b65e855f6db9fc2eae1 (patch) | |
| tree | b1fe46737ed9f99a400f306d08f2cb53515a5311 | |
| parent | KviIrcConnection: Topple the leaning tower of if statements (diff) | |
| download | KVIrc-e3306538d085d284006d3b65e855f6db9fc2eae1.tar.gz KVIrc-e3306538d085d284006d3b65e855f6db9fc2eae1.tar.bz2 KVIrc-e3306538d085d284006d3b65e855f6db9fc2eae1.zip | |
libkvitrayicon: Use C++ headers instead
| -rw-r--r-- | src/modules/trayicon/libkvitrayicon.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/modules/trayicon/libkvitrayicon.cpp b/src/modules/trayicon/libkvitrayicon.cpp index cc4395aa5..e2a1855c9 100644 --- a/src/modules/trayicon/libkvitrayicon.cpp +++ b/src/modules/trayicon/libkvitrayicon.cpp @@ -50,8 +50,8 @@ #include <QWidgetAction> #include <QMenu> -#include <stdlib.h> -#include <time.h> +#include <cstdlib> +#include <ctime> #include <map> #if defined(COMPILE_ON_WINDOWS) || defined(COMPILE_ON_MINGW) @@ -226,12 +226,10 @@ bool KviTrayIconWidget::event(QEvent * e) } } - srand(time(nullptr)); - // We use the bad way to generate random numbers :))))) - + std::srand(std::time(nullptr)); if(tmp.isEmpty()) - tmp = __tr2qs_no_xgettext(idlemsgs[(int)(rand() % NIDLEMSGS)]); + tmp = __tr2qs_no_xgettext(idlemsgs[(int)(std::rand() % NIDLEMSGS)]); m_Tip.tip(QRect(pos, QSize(0, 0)), tmp); return true; |
