diff options
author | Edwin Mons <edwin.mons@isode.com> | 2018-10-30 07:24:24 (GMT) |
---|---|---|
committer | Edwin Mons <edwin.mons@isode.com> | 2018-11-14 10:35:55 (GMT) |
commit | 30639ed8dbb419890eab5a0b46d3a78896c7f22d (patch) | |
tree | 62b7a3b19bc3d84bfc0a0d4ac71a79beb0946e8c /SwifTools/Dock | |
parent | 5758cc48f5f340132d19e79f647dd5d3ad8c54fc (diff) | |
download | swift-30639ed8dbb419890eab5a0b46d3a78896c7f22d.zip swift-30639ed8dbb419890eab5a0b46d3a78896c7f22d.tar.bz2 |
Fix various uses of numeric_cast in UI bits
Apart from QtUI bits, this addresses use of uncaught numeric cast
exceptions in message count handling, the spell parser and the MacOS
idle querier.
The WindowsServicePrincipalName logic previously had an issue where
using ports from 32768 onwards would result in a bad_numeric_cast
exception to be thrown. This has been addressed at the same time as the
uncaught exceptions, and all ports should work now.
The tags file has been extended to ignore more files.
Change-Id: I73ced35f06517bee5c58f990d20fa437b40ac84e
Diffstat (limited to 'SwifTools/Dock')
-rw-r--r-- | SwifTools/Dock/Dock.h | 6 | ||||
-rw-r--r-- | SwifTools/Dock/MacOSXDock.h | 4 | ||||
-rw-r--r-- | SwifTools/Dock/MacOSXDock.mm | 4 | ||||
-rw-r--r-- | SwifTools/Dock/NullDock.h | 6 | ||||
-rw-r--r-- | SwifTools/Dock/WindowsDock.h | 4 |
5 files changed, 14 insertions, 10 deletions
diff --git a/SwifTools/Dock/Dock.h b/SwifTools/Dock/Dock.h index 6120445..362aabc 100644 --- a/SwifTools/Dock/Dock.h +++ b/SwifTools/Dock/Dock.h @@ -1,11 +1,13 @@ /* - * Copyright (c) 2010 Isode Limited. + * Copyright (c) 2010-2018 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ #pragma once +#include <cstddef> + namespace Swift { @@ -13,6 +15,6 @@ namespace Swift { public: virtual ~Dock(); - virtual void setNumberOfPendingMessages(int i) = 0; + virtual void setNumberOfPendingMessages(size_t i) = 0; }; } diff --git a/SwifTools/Dock/MacOSXDock.h b/SwifTools/Dock/MacOSXDock.h index 6b33506..ef85a88 100644 --- a/SwifTools/Dock/MacOSXDock.h +++ b/SwifTools/Dock/MacOSXDock.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010 Isode Limited. + * Copyright (c) 2010-2018 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -16,6 +16,6 @@ namespace Swift { public: MacOSXDock(CocoaApplication* application); - virtual void setNumberOfPendingMessages(int i); + virtual void setNumberOfPendingMessages(size_t i); }; } diff --git a/SwifTools/Dock/MacOSXDock.mm b/SwifTools/Dock/MacOSXDock.mm index 5c7207c..3935ac0 100644 --- a/SwifTools/Dock/MacOSXDock.mm +++ b/SwifTools/Dock/MacOSXDock.mm @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015-2016 Isode Limited. + * Copyright (c) 2015-2018 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -18,7 +18,7 @@ namespace Swift { MacOSXDock::MacOSXDock(CocoaApplication*) { } -void MacOSXDock::setNumberOfPendingMessages(int i) { +void MacOSXDock::setNumberOfPendingMessages(size_t i) { std::string label(i > 0 ? boost::lexical_cast<std::string>(i) : ""); NSString *labelString = [[NSString alloc] initWithUTF8String: label.c_str()]; [[NSApp dockTile] setBadgeLabel: labelString]; diff --git a/SwifTools/Dock/NullDock.h b/SwifTools/Dock/NullDock.h index 9f3c554..137ba03 100644 --- a/SwifTools/Dock/NullDock.h +++ b/SwifTools/Dock/NullDock.h @@ -1,11 +1,13 @@ /* - * Copyright (c) 2010 Isode Limited. + * Copyright (c) 2010-2018 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ #pragma once +#include <cstddef> + #include <SwifTools/Dock/Dock.h> namespace Swift { @@ -13,7 +15,7 @@ namespace Swift { public: NullDock() {} - virtual void setNumberOfPendingMessages(int) { + virtual void setNumberOfPendingMessages(size_t) { } }; } diff --git a/SwifTools/Dock/WindowsDock.h b/SwifTools/Dock/WindowsDock.h index fc10a48..f9a9dae 100644 --- a/SwifTools/Dock/WindowsDock.h +++ b/SwifTools/Dock/WindowsDock.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010-2016 Isode Limited. + * Copyright (c) 2010-2018 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -18,7 +18,7 @@ namespace Swift { public: WindowsDock(QSystemTrayIcon* tray, Notifier* notifier) : tray(tray), notifier(notifier) {} - virtual void setNumberOfPendingMessages(int i) { + virtual void setNumberOfPendingMessages(size_t i) { if (notifier->isAvailable()) { return; } |