[KDE/Mac] KDE/kdelibs/kdeui

Frank Osterfeld frank.osterfeld at kdemail.net
Tue Dec 28 16:32:05 CET 2010


SVN commit 1209931 by osterfeld:

Add an OS X keychain backend for kwallet. Not all concepts from KWallet (folders, in particular, which are not available as such in keychain) are supported 
yet. However, I used it successfully in KDE 4.3/4.4 times with Kontact.

To enable it, pass -DMAC_USE_OSXKEYCHAIN=true to cmake.

CCMAIL=kde-mac at kde.org, bjoern.ricks at intevation.de, adam at kde.org


 M  +14 -1     CMakeLists.txt  
 M  +4 -0      util/kwallet.cpp  
 M  +6 -0      util/kwallet.h  
 A             util/kwallet_mac.cpp   [License: LGPL (v2+)]


--- trunk/KDE/kdelibs/kdeui/CMakeLists.txt #1209930:1209931
@@ -207,7 +207,6 @@
  util/kpixmapcache.cpp
  util/kpixmapprovider.cpp
  util/kstandardguiitem.cpp
- util/kwallet.cpp
  util/kwordwrap.cpp
  util/kxerrorhandler.cpp
  util/kxmessages.cpp
@@ -289,6 +288,17 @@
 )
 endif(NOT KDE_NO_DEPRECATED)
 
+option(MAC_USE_OSXKEYCHAIN "On OS X, use the keychain as backend for kwallet, instead of kwalletd.")
+
+if (Q_WS_MAC AND MAC_USE_OSXKEYCHAIN)
+    FIND_LIBRARY(SECURITY_LIBRARY Security)
+    set(kdeui_LIB_SRCS ${kdeui_LIB_SRCS} util/kwallet_mac.cpp)
+else(Q_WS_MAC AND MAC_USE_OSXKEYCHAIN)
+     set(kdeui_LIB_SRCS ${kdeui_LIB_SRCS} util/kwallet.cpp)
+else(Q_WS_MAC AND MAC_USE_OSXKEYCHAIN)
+  set(kdeui_LIB_SRCS ${kdeui_LIB_SRCS} util/kwallet.cpp)
+endif(Q_WS_MAC AND MAC_USE_OSXKEYCHAIN)
+
 if(NOT WINCE)
 set(kdeui_LIB_SRCS
  ${kdeui_LIB_SRCS}
@@ -409,6 +419,9 @@
 
 if(Q_WS_MAC)
    target_link_libraries(kdeui ${CARBON_LIBRARY})
+   if (MAC_USE_OSXKEYCHAIN)
+     target_link_libraries(kdeui ${SECURITY_LIBRARY})
+   endif (MAC_USE_OSXKEYCHAIN)
 endif(Q_WS_MAC)
 
 if(X11_XTest_FOUND)
--- trunk/KDE/kdelibs/kdeui/util/kwallet.cpp #1209930:1209931
@@ -838,6 +838,10 @@
     emit walletOpened(false);
 }
 
+void Wallet::emitWalletOpened() {
+  emit walletOpened(true);
+}
+
 bool Wallet::folderDoesNotExist(const QString& wallet, const QString& folder)
 {
     QDBusReply<bool> r = walletLauncher->getInterface().folderDoesNotExist(wallet, folder);
--- trunk/KDE/kdelibs/kdeui/util/kwallet.h #1209930:1209931
@@ -497,6 +497,12 @@
 		 */
 		void emitWalletAsyncOpenError();
 
+		/**
+		 *  @internal
+		 *  Emits wallet opening success.
+		 */
+		void emitWalletOpened();
+
 	private:
 		class WalletPrivate;
 		WalletPrivate* const d;


More information about the kde-mac mailing list