Bugzilla – Attachment 55015 Details for
Bug 129841
Patch for kinternet to save WEP keys to KWallet
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
IDP Log In
|
Forgot Password
[patch]
Patch for KWallet functionality
wep-kwallet.patch (text/plain), 3.74 KB, created by
Janos Barbero
on 2005-10-20 19:54:43 UTC
(
hide
)
Description:
Patch for KWallet functionality
Filename:
MIME Type:
Creator:
Janos Barbero
Created:
2005-10-20 19:54:43 UTC
Size:
3.74 KB
patch
obsolete
>diff -Naur kinternet-0.72/kinternet/wepkeyinputdialog.cpp kinternet-kwallet/kinternet/wepkeyinputdialog.cpp >--- kinternet-0.72/kinternet/wepkeyinputdialog.cpp 2005-03-12 16:47:28.000000000 +0000 >+++ kinternet-kwallet/kinternet/wepkeyinputdialog.cpp 2005-10-19 19:46:48.000000000 +0000 >@@ -27,11 +27,28 @@ > > // Own Header > #include "wepkeyinputdialog.h" >+#include <kwallet.h> >+ >+#define WALLET_NAME "kinternet_wepkeys" >+ >+KWallet::Wallet* wallet = 0; >+QString essid; >+QString idtype, idmode; > > /*! The default constructor of the class */ >-WepkeyInputDialog::WepkeyInputDialog(QWidget *parent, const char *name) >+WepkeyInputDialog::WepkeyInputDialog(QString _essid, QWidget *parent, const char *name) > : wepKey_Inputdialog(parent, name) > { >+ >+ QString walletName = tr(WALLET_NAME); >+ QString wepkey, keytype, authmode; >+ bool walletOK = false; >+ >+ essid = _essid; >+ >+ idtype = (&essid)->append( 't' ); >+ idmode = (&essid)->append( 'm' ); >+ > // fill the dropdownbox > comboB_authmode->insertItem("open"); > comboB_authmode->insertItem("shared"); >@@ -40,6 +57,38 @@ > comboB_keytype->insertItem("ascii"); > comboB_keytype->insertItem("hash (64 bit)"); > comboB_keytype->insertItem("hash (128 bit)"); >+ >+ if (KWallet::Wallet::isEnabled()) >+ { >+ // Open local wallet >+ wallet = KWallet::Wallet::openWallet(KWallet::Wallet::LocalWallet()); >+ if (wallet != 0) >+ { >+ // Check if folder exists, otherwise create it >+ walletOK = wallet->hasFolder(walletName); >+ if (walletOK == false) >+ { >+ walletOK = wallet->createFolder(walletName); >+ } >+ // Read password entry >+ if (walletOK == true) >+ { >+ if(wallet->readPassword( essid, wepkey ) == 0) >+ { >+ lineEdit_wepkey->setText( wepkey ); >+ } >+// if(wallet->readPassword( idtype, keytype ) == 0) >+// { >+// comboB_keytype->setCurrentText( keytype ); >+// } >+// if(wallet->readPassword( idmode, authmode ) == 0) >+// { >+// comboB_authmode->setCurrentText( authmode ); >+// } >+ } >+ } >+ } >+ > } > > /*! The default destructor of the class */ >@@ -52,8 +101,10 @@ > */ > void WepkeyInputDialog::accept(){ > wep_key = lineEdit_wepkey->text(); >- >+ wallet->writePassword( essid, wep_key ); >+ > wep_key_type = comboB_keytype->currentText(); >+// wallet->writePassword( idtype, wep_key_type ); > > if(wep_key_type.startsWith("hash (64 bit)")) { > wep_key_type = "hash40"; >@@ -63,6 +114,7 @@ > } > > authmode = comboB_authmode->currentText(); >+// wallet->writePassword( idmode, authmode ); > > close(); > } >diff -Naur kinternet-0.72/kinternet/wepkeyinputdialog.h kinternet-kwallet/kinternet/wepkeyinputdialog.h >--- kinternet-0.72/kinternet/wepkeyinputdialog.h 2005-03-03 15:35:30.000000000 +0000 >+++ kinternet-kwallet/kinternet/wepkeyinputdialog.h 2005-10-20 19:07:57.000000000 +0000 >@@ -30,7 +30,7 @@ > public: > > //! the default constructor >- WepkeyInputDialog(QWidget *parent = 0, const char *name = 0); >+ WepkeyInputDialog(QString essid, QWidget *parent = 0, const char *name = 0); > //! the default destructor > ~WepkeyInputDialog(); > >diff -Naur kinternet-0.72/kinternet/wirelessdialog.cpp kinternet-kwallet/kinternet/wirelessdialog.cpp >--- kinternet-0.72/kinternet/wirelessdialog.cpp 2005-03-18 16:43:39.000000000 +0000 >+++ kinternet-kwallet/kinternet/wirelessdialog.cpp 2005-10-19 19:47:17.000000000 +0000 >@@ -44,7 +44,6 @@ > #include "wirelessdialog.h" > > >- > /*! The default constructor of the class */ > WirelessDialog::WirelessDialog(Server* _server, QString _interface, QWidget *parent, const char *name) > :Wireless_Dialog(parent, name, false, WDestructiveClose) >@@ -213,7 +212,7 @@ > // if WEP needed display dialog > if(wep_needed){ > >- wepkeydialog = new WepkeyInputDialog(); >+ wepkeydialog = new WepkeyInputDialog(to_check_essid); > wepkeydialog->exec(); > > QString wep_key = wepkeydialog->wep_key;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
Actions:
View
|
Diff
Attachments on
bug 129841
: 55015