diff options
Diffstat (limited to 'Slimber')
| -rw-r--r-- | Slimber/Cocoa/CocoaMenulet.mm | 10 | ||||
| -rw-r--r-- | Slimber/Cocoa/MainMenu.xib | 2 | ||||
| -rw-r--r-- | Slimber/MainController.cpp | 4 | ||||
| -rw-r--r-- | Slimber/SConscript | 4 | ||||
| -rw-r--r-- | Slimber/Server.cpp | 8 | ||||
| -rw-r--r-- | Slimber/Server.h | 14 | ||||
| -rw-r--r-- | Slimber/UnitTest/LinkLocalPresenceManagerTest.cpp | 10 | 
7 files changed, 28 insertions, 24 deletions
| diff --git a/Slimber/Cocoa/CocoaMenulet.mm b/Slimber/Cocoa/CocoaMenulet.mm index a05843e..3bb39da 100644 --- a/Slimber/Cocoa/CocoaMenulet.mm +++ b/Slimber/Cocoa/CocoaMenulet.mm @@ -1,5 +1,5 @@  /* - * Copyright (c) 2012-2016 Isode Limited. + * Copyright (c) 2012-2019 Isode Limited.   * All rights reserved.   * See the COPYING file for more information.   */ @@ -17,9 +17,9 @@ CocoaMenulet::CocoaMenulet() {      statusItem = [[[NSStatusBar systemStatusBar]              statusItemWithLength: NSVariableStatusItemLength] retain]; -    [statusItem setHighlightMode: YES]; -    [statusItem setEnabled: YES]; -    [statusItem setToolTip: @"Slimber"]; +    [statusItem.button.cell setHighlightsBy: NSChangeGrayCellMask | NSChangeBackgroundCellMask]; +    [statusItem.button setEnabled: YES]; +    [statusItem.button setToolTip: @"Slimber"];      [statusItem setMenu: menu];  } @@ -32,7 +32,7 @@ CocoaMenulet::~CocoaMenulet() {  void CocoaMenulet::setIcon(const std::string& icon) {      NSString* path = [[NSBundle mainBundle] pathForResource: std2NSString(icon) ofType:@"png"];      NSImage* image = [[NSImage alloc] initWithContentsOfFile: path]; -    [statusItem setImage: image]; +    [statusItem.button setImage: image];      [image release];  } diff --git a/Slimber/Cocoa/MainMenu.xib b/Slimber/Cocoa/MainMenu.xib index bed7223..fb124d4 100644 --- a/Slimber/Cocoa/MainMenu.xib +++ b/Slimber/Cocoa/MainMenu.xib @@ -1,7 +1,7 @@  <?xml version="1.0" encoding="UTF-8"?>  <archive type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="7.03">  	<data> -		<int key="IBDocument.SystemTarget">1050</int> +		<int key="IBDocument.SystemTarget">1060</int>  		<string key="IBDocument.SystemVersion">9J61</string>  		<string key="IBDocument.InterfaceBuilderVersion">677</string>  		<string key="IBDocument.AppKitVersion">949.46</string> diff --git a/Slimber/MainController.cpp b/Slimber/MainController.cpp index cd36132..93eb4e7 100644 --- a/Slimber/MainController.cpp +++ b/Slimber/MainController.cpp @@ -102,13 +102,13 @@ void MainController::handleServerStopped(boost::optional<ServerError> error) {          std::string message;          switch (error->getType()) {              case ServerError::C2SPortConflict: -                message = std::string("Error: Port ") + boost::lexical_cast<std::string>(server->getClientToServerPort()) + std::string(" in use"); +                message = std::string("Error: Port ") + std::to_string(server->getClientToServerPort()) + std::string(" in use");                  break;              case ServerError::C2SError:                  message = std::string("Local connection server error");               break;              case ServerError::LinkLocalPortConflict: -                message = std::string("Error: Port ") + boost::lexical_cast<std::string>(server->getLinkLocalPort()) + std::string(" in use"); +                message = std::string("Error: Port ") + std::to_string(server->getLinkLocalPort()) + std::string(" in use");                  break;              case ServerError::LinkLocalError:                  message = std::string("External connection server error"); diff --git a/Slimber/SConscript b/Slimber/SConscript index a41fe0b..fa5aa53 100644 --- a/Slimber/SConscript +++ b/Slimber/SConscript @@ -11,10 +11,10 @@ elif env["PLATFORM"] != "darwin" :          env["PROJECTS"].remove("Slimber")  if not "Slimber" in env["PROJECTS"] and env["SCONS_STAGE"] == "flags" : -        print "Bonjour missing. Not building Slimber." +        print("Bonjour missing. Not building Slimber.")  if not env.get("HAVE_QT", False) and "Slimber" in env["PROJECTS"] : -    print "Qt missing. Not building Slimber." +    print("Qt missing. Not building Slimber.")      env["PROJECTS"].remove("Slimber")  if "Slimber" in env["PROJECTS"] : diff --git a/Slimber/Server.cpp b/Slimber/Server.cpp index 3bc3112..7bb2ed9 100644 --- a/Slimber/Server.cpp +++ b/Slimber/Server.cpp @@ -1,5 +1,5 @@  /* - * Copyright (c) 2010-2016 Isode Limited. + * Copyright (c) 2010-2019 Isode Limited.   * All rights reserved.   * See the COPYING file for more information.   */ @@ -39,8 +39,8 @@  namespace Swift {  Server::Server( -        int clientConnectionPort, -        int linkLocalConnectionPort, +        unsigned short clientConnectionPort, +        unsigned short linkLocalConnectionPort,          LinkLocalServiceBrowser* linkLocalServiceBrowser,          VCardCollection* vCardCollection,          EventLoop* eventLoop) : @@ -306,7 +306,7 @@ void Server::handleLinkLocalElementReceived(std::shared_ptr<ToplevelElement> ele  void Server::handleConnectFinished(std::shared_ptr<LinkLocalConnector> connector, bool error) {      if (error) { -        SWIFT_LOG(warning) << "Error connecting" << std::endl; +        SWIFT_LOG(warning) << "Error connecting";          // TODO: Send back queued stanzas      }      else { diff --git a/Slimber/Server.h b/Slimber/Server.h index 4842cd9..2ee5a4a 100644 --- a/Slimber/Server.h +++ b/Slimber/Server.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.   */ @@ -41,8 +41,8 @@ namespace Swift {      class Server {          public:              Server( -                    int clientConnectionPort, -                    int linkLocalConnectionPort, +                    unsigned short clientConnectionPort, +                    unsigned short linkLocalConnectionPort,                      LinkLocalServiceBrowser* browser,                      VCardCollection* vCardCollection,                      EventLoop* eventLoop); @@ -51,11 +51,11 @@ namespace Swift {              void start();              void stop(); -            int getLinkLocalPort() const { +            unsigned short getLinkLocalPort() const {                  return linkLocalConnectionPort;              } -            int getClientToServerPort() const { +            unsigned short getClientToServerPort() const {                  return clientConnectionPort;              } @@ -105,8 +105,8 @@ namespace Swift {              PlatformXMLParserFactory xmlParserFactory;              bool linkLocalServiceRegistered;              bool rosterRequested; -            int clientConnectionPort; -            int linkLocalConnectionPort; +            unsigned short clientConnectionPort; +            unsigned short linkLocalConnectionPort;              LinkLocalServiceBrowser* linkLocalServiceBrowser;              VCardCollection* vCardCollection;              EventLoop* eventLoop; diff --git a/Slimber/UnitTest/LinkLocalPresenceManagerTest.cpp b/Slimber/UnitTest/LinkLocalPresenceManagerTest.cpp index c8e7700..b1a51c9 100644 --- a/Slimber/UnitTest/LinkLocalPresenceManagerTest.cpp +++ b/Slimber/UnitTest/LinkLocalPresenceManagerTest.cpp @@ -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.   */ @@ -225,7 +225,9 @@ class LinkLocalPresenceManagerTest : public CppUnit::TestFixture {              info.setFirstName(firstName);              info.setLastName(lastName);              info.setNick(nickName); -            querier->setServiceInfo(service, DNSSDResolveServiceQuery::Result(name + "._presence._tcp.local", "rabbithole.local", 1234, info.toTXTRecord())); +            auto txtRecord = info.toTXTRecord(); +            CPPUNIT_ASSERT(txtRecord); +            querier->setServiceInfo(service, DNSSDResolveServiceQuery::Result(name + "._presence._tcp.local", "rabbithole.local", 1234, *txtRecord));              querier->addService(service);              eventLoop->processEvents();          } @@ -241,7 +243,9 @@ class LinkLocalPresenceManagerTest : public CppUnit::TestFixture {              LinkLocalServiceInfo info;              info.setStatus(status);              info.setMessage(message); -            querier->setServiceInfo(service, DNSSDResolveServiceQuery::Result(name + "._presence._tcp.local", "rabbithole.local", 1234, info.toTXTRecord())); +            auto txtRecord = info.toTXTRecord(); +            CPPUNIT_ASSERT(txtRecord); +            querier->setServiceInfo(service, DNSSDResolveServiceQuery::Result(name + "._presence._tcp.local", "rabbithole.local", 1234, *txtRecord));              eventLoop->processEvents();          } | 
 Swift
 Swift