From 8e4a860d9867efed3d2600f21e6e1fef342c236c Mon Sep 17 00:00:00 2001 From: Joseph Marrero Date: Tue, 7 Jan 2014 09:29:33 -0400 Subject: [PATCH] Initial import(#1046340). --- .gitignore | 1 + qtkeychain.spec | 77 +++++++++++++++++++++++++++++++++++++++++ sources | 1 + use_network_wallet.diff | 44 +++++++++++++++++++++++ 4 files changed, 123 insertions(+) create mode 100644 qtkeychain.spec create mode 100644 use_network_wallet.diff diff --git a/.gitignore b/.gitignore index e69de29..ec140d7 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1 @@ +/qtkeychain-0.20130805.tar.bz2 diff --git a/qtkeychain.spec b/qtkeychain.spec new file mode 100644 index 0000000..06fc012 --- /dev/null +++ b/qtkeychain.spec @@ -0,0 +1,77 @@ +Name: qtkeychain +Version: 0.1.0 +Release: 4.20130805git%{?dist} +License: BSD +Summary: A password store library +Url: https://github.com/frankosterfeld/qtkeychain +Source0: %{name}-0.20130805.tar.bz2 + +Patch0: use_network_wallet.diff + +BuildRequires: cmake +BuildRequires: qt4-devel + +%description +The qtkeychain library allows you to store passwords easy and secure. + +%package devel +Summary: A cross platform password store library +Requires: %{name}%{?_isa} = %{version}-%{release} + +%description devel +This package contains development files for qtkeychain. + +%prep +%setup -q -n %{name}-0.20130805 + +%patch0 -p1 + +%build +mkdir build +pushd build + +%cmake .. \ + -DCMAKE_INSTALL_PREFIX=%{_prefix} \ + -DCMAKE_BUILD_TYPE=RelWithDebInfo \ + -DCMAKE_VERBOSE_MAKEFILE=ON \ + -DBUILD_RELEASE=ON + +make %{?_smp_mflags} +popd + +%install +pushd build +make install DESTDIR=%{buildroot} +popd + +%post -p /sbin/ldconfig + +%postun -p /sbin/ldconfig + +%files +%{_libdir}/libqtkeychain.so.* +%{_datadir}/qt4/translations/qtkeychain_de.qm +%doc COPYING ReadMe.txt + +%files devel +%{_includedir}/qtkeychain +%{_libdir}/cmake/QtKeychain/ +%{_libdir}/libqtkeychain.so + +%changelog +* Tue Jan 07 2014 0.1.0-4.20130805git +- Remove gcc-c++ dep +- Fix Requires +- Remove unneeded line in devel description +- Leave black line between changelogs + +* Sat Jan 04 2014 0.1.0-3.20130805git +- Fix Version and Release +- Fix %%files devel's cmake ownership by pointing the subfiles +- Fix Changelog to reflect version and release changes + +* Tue Dec 24 2013 0.1.0-2.20130805git +- Fix descriptions + +* Mon Dec 23 2013 0.1.0-1.20130805git +- Initial Packaging diff --git a/sources b/sources index e69de29..4565e52 100644 --- a/sources +++ b/sources @@ -0,0 +1 @@ +91a3f9f6d35fe5b6e361f9acaa9f8865 qtkeychain-0.20130805.tar.bz2 diff --git a/use_network_wallet.diff b/use_network_wallet.diff new file mode 100644 index 0000000..9c0a4e5 --- /dev/null +++ b/use_network_wallet.diff @@ -0,0 +1,44 @@ +diff --git a/keychain_dbus.cpp b/keychain_dbus.cpp +index 4b39348..15e0ee1 100644 +--- a/keychain_dbus.cpp ++++ b/keychain_dbus.cpp +@@ -170,9 +170,9 @@ void ReadPasswordJobPrivate::scheduledStart() { + if ( QDBusConnection::sessionBus().isConnected() ) + { + iface = new org::kde::KWallet( QLatin1String("org.kde.kwalletd"), QLatin1String("/modules/kwalletd"), QDBusConnection::sessionBus(), this ); +- const QDBusPendingReply reply = iface->open( QLatin1String("kdewallet"), 0, q->service() ); ++ const QDBusPendingReply reply = iface->networkWallet(); + QDBusPendingCallWatcher* watcher = new QDBusPendingCallWatcher( reply, this ); +- connect( watcher, SIGNAL(finished(QDBusPendingCallWatcher*)), this, SLOT(kwalletOpenFinished(QDBusPendingCallWatcher*)) ); ++ connect( watcher, SIGNAL(finished(QDBusPendingCallWatcher*)), this, SLOT(kwalletWalletFound(QDBusPendingCallWatcher*)) ); + } + else + { +@@ -184,6 +184,15 @@ void ReadPasswordJobPrivate::scheduledStart() { + } + } + ++void ReadPasswordJobPrivate::kwalletWalletFound(QDBusPendingCallWatcher *watcher) ++{ ++ watcher->deleteLater(); ++ const QDBusPendingReply reply = *watcher; ++ const QDBusPendingReply pendingReply = iface->open( reply.value(), 0, q->service() ); ++ QDBusPendingCallWatcher* pendingWatcher = new QDBusPendingCallWatcher( pendingReply, this ); ++ connect( pendingWatcher, SIGNAL(finished(QDBusPendingCallWatcher*)), this, SLOT(kwalletOpenFinished(QDBusPendingCallWatcher*)) ); ++} ++ + static QPair mapGnomeKeyringError( int result ) + { + Q_ASSERT( result != GnomeKeyring::RESULT_OK ); +diff --git a/keychain_p.h b/keychain_p.h +index 4facbc6..31fad8a 100644 +--- a/keychain_p.h ++++ b/keychain_p.h +@@ -74,6 +74,7 @@ class ReadPasswordJobPrivate : public QObject { + const QString typeKey(); + const QString dataKey(); + private Q_SLOTS: ++ void kwalletWalletFound( QDBusPendingCallWatcher* watcher ); + void kwalletOpenFinished( QDBusPendingCallWatcher* watcher ); + void kwalletEntryTypeFinished( QDBusPendingCallWatcher* watcher ); + void kwalletReadFinished( QDBusPendingCallWatcher* watcher );