Fixed: "KeepassX 0.3.3 fails to lock itself after Ctrl-V (autotype)" (Bug #2106604)

Clear Klipper history on KDE4

git-svn-id: https://svn.code.sf.net/p/keepassx/code/trunk@230 b624d157-de02-0410-bad0-e51aec6abb33
master
sniperbeamer 15 years ago
parent f533ea45a7
commit a8fafee769
  1. 4
      share/applications/keepassx.desktop
  2. 4
      share/mimelnk/application/x-keepass.desktop
  3. 4
      src/dialogs/AutoTypeDlg.cpp
  4. 3
      src/dialogs/AutoTypeDlg.h
  5. 2
      src/lib/AutoType.h
  6. 25
      src/lib/AutoType_X11.cpp
  7. 13
      src/lib/EntryView.cpp

@ -3,7 +3,7 @@ Name=KeePassX
GenericName=Cross Platform Password Manager
GenericName[de]=Passwortverwaltung
GenericName[fr]=Gestionnaire de mot de passe
Exec=keepassx
Exec=keepassx %f
Icon=keepassx
Comment=Cross Platform Password Manager
Comment[de]=Passwortverwaltung
@ -11,4 +11,4 @@ Comment[fr]=Gestionnaire de mot de passe
Terminal=false
Type=Application
Categories=Qt;Utility;
MimeType=application/x-keepass
MimeType=application/x-keepass;

@ -3,6 +3,6 @@ Comment=KeePass database
Comment[de]=KeePass Datenbank
Hidden=false
Icon=keepassx
MimeType=application/x-keepass
Patterns=*.kdb
MimeType=application/x-keepass;
Patterns=*.kdb;
Type=MimeType

@ -19,7 +19,7 @@
#include <QDesktopWidget>
#include "AutoTypeDlg.h"
AutoTypeDlg::AutoTypeDlg(QList<IEntryHandle*> entries, QList<int> numbers){
AutoTypeDlg::AutoTypeDlg(QList<IEntryHandle*> entries, QList<int> numbers, bool wasLocked) : pWasLocked(wasLocked){
setupUi(this);
setAttribute(Qt::WA_DeleteOnClose);
@ -101,5 +101,5 @@ bool AutoTypeDlg::event(QEvent* event){
void AutoTypeDlg::itemSelected(QTreeWidgetItem* item){
close();
QString err;
AutoType::perform(itemToEntry[item].dbHandle,err,false,itemToEntry[item].nr);
AutoType::perform(itemToEntry[item].dbHandle, err, pWasLocked, itemToEntry[item].nr, pWasLocked);
}

@ -24,7 +24,7 @@ class AutoTypeDlg : public QWidget, private Ui::AutoTypeDlg
Q_OBJECT
public:
AutoTypeDlg(QList<IEntryHandle*> entries, QList<int> numbers);
AutoTypeDlg(QList<IEntryHandle*> entries, QList<int> numbers, bool wasLocked);
protected:
void paintEvent(QPaintEvent* event);
@ -42,4 +42,5 @@ class AutoTypeDlg : public QWidget, private Ui::AutoTypeDlg
static bool itemLessThan(QTreeWidgetItem* i1, QTreeWidgetItem* i2);
QHash<QTreeWidgetItem*,AutoTypeEntry> itemToEntry;
QPixmap BannerPixmap;
bool pWasLocked;
};

@ -34,7 +34,7 @@ class KeepassMainWindow;
class AutoType{
public:
static KeepassMainWindow* MainWin;
static void perform(IEntryHandle* entry, QString& err,bool hideWindow=true,int nr=0);
static void perform(IEntryHandle* entry, QString& err,bool hideWindow=true,int nr=0,bool wasLocked=false);
#ifdef GLOBAL_AUTOTYPE
static Shortcut shortcut;
static void performGlobal();

@ -55,7 +55,7 @@ KeepassMainWindow* AutoType::MainWin=NULL;
Shortcut AutoType::shortcut;
#endif
void AutoType::perform(IEntryHandle* entry, QString& err,bool hideWindow,int nr){
void AutoType::perform(IEntryHandle* entry, QString& err,bool hideWindow,int nr,bool wasLocked){
QString indexStr;
if (nr==0)
indexStr = "Auto-Type:";
@ -154,8 +154,20 @@ void AutoType::perform(IEntryHandle* entry, QString& err,bool hideWindow,int nr)
XTestFakeKeyEvent(pDisplay,XKeysymToKeycode(pDisplay,XK_Caps_Lock),false,0);
}
if (hideWindow && !(config->showSysTrayIcon() && config->minimizeTray()) )
MainWin->showMinimized();
if (config->lockOnMinimize()){
if (hideWindow || wasLocked){
if ( !(config->showSysTrayIcon() && config->minimizeTray()) )
MainWin->showMinimized();
else
MainWin->OnUnLockWorkspace();
}
}
else{
if (hideWindow && !(config->showSysTrayIcon() && config->minimizeTray()) )
MainWin->showMinimized();
if (wasLocked)
MainWin->OnUnLockWorkspace();
}
}
#ifdef GLOBAL_AUTOTYPE
@ -230,7 +242,8 @@ QStringList AutoType::getAllWindowTitles(){
}
void AutoType::performGlobal(){
if (MainWin->isLocked())
bool wasLocked = MainWin->isLocked();
if (wasLocked)
MainWin->OnUnLockWorkspace();
if (!MainWin->isOpened())
@ -334,10 +347,10 @@ void AutoType::performGlobal(){
if (validEntries.size()==1){
QString err;
perform(validEntries[0],err,false,entryNumbers[0]);
perform(validEntries[0],err,wasLocked,entryNumbers[0],wasLocked);
}
else if (validEntries.size()>1){
AutoTypeDlg* dlg = new AutoTypeDlg(validEntries, entryNumbers);
AutoTypeDlg* dlg = new AutoTypeDlg(validEntries, entryNumbers, wasLocked);
dlg->show();
}
}

@ -322,10 +322,17 @@ void KeepassEntryView::OnClipboardTimeOut(){
Clipboard->clear(QClipboard::Selection);
}
#ifdef Q_WS_X11
static bool clearKlipper = true;
if (clearKlipper){
static bool clearKlipper3 = true;
static bool clearKlipper4 = true;
if (clearKlipper3){
if (QProcess::execute("dcop klipper klipper clearClipboardHistory")!=0)
clearKlipper = false;
clearKlipper3 = false;
}
if (clearKlipper4){
if (QProcess::execute("dbus-send --type=method_call --print-reply --dest=org.kde.klipper /klipper org.kde.klipper.klipper.clearClipboardHistory")!=0)
clearKlipper4 = false;
}
#endif
}