Skip to content

Commit

Permalink
Replace custom X11 keyboard modifier checks.
Browse files Browse the repository at this point in the history
KDE now provides this functionality directly.
  • Loading branch information
Dr. Robert Marmorstein authored and mattrdash committed Aug 23, 2011
1 parent 2cf5408 commit 0bd017a
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 171 deletions.
1 change: 0 additions & 1 deletion src/CMakeLists.txt
Expand Up @@ -27,7 +27,6 @@ set(basketcommon_LIB_SRCS
htmlexporter.cpp
history.cpp
kcolorcombo2.cpp
keyboard.cpp
kgpgme.cpp
likeback.cpp
linklabel.cpp
Expand Down
130 changes: 0 additions & 130 deletions src/keyboard.cpp

This file was deleted.

37 changes: 0 additions & 37 deletions src/keyboard.h

This file was deleted.

8 changes: 5 additions & 3 deletions src/notefactory.cpp
Expand Up @@ -35,6 +35,7 @@
#include <QtGui/QMovie>
#include <QtGui/QTextDocument> //For Qt::mightBeRichText(...)
#include <QtGui/QBitmap> //For createHeuristicMask
#include <QtCore/qnamespace.h>

#include <KDE/KUrl>
#include <KDE/KMimeType>
Expand All @@ -47,6 +48,7 @@
#include <KDE/KMenu>
#include <KDE/KUriFilter>
#include <KDE/KIconDialog>
#include <KDE/KModifierKeyInfo>
#include <KDE/KAboutData> //For KGlobal::mainComponent().aboutData(...)

#include <KDE/KIO/CopyJob>
Expand All @@ -57,7 +59,6 @@
#include "notedrag.h"
#include "global.h"
#include "settings.h"
#include "keyboard.h"
#include "variouswidgets.h" //For IconSizeDialog
#include "tools.h"

Expand Down Expand Up @@ -514,9 +515,10 @@ Note* NoteFactory::createNoteUnknown(const QMimeData *source, BasketView *parent

Note* NoteFactory::dropURLs(KUrl::List urls, BasketView *parent, Qt::DropAction action, bool fromDrop)
{
KModifierKeyInfo keyinfo;
int shouldAsk = 0; // shouldAsk==0: don't ask ; shouldAsk==1: ask for "file" ; shouldAsk>=2: ask for "files"
bool shiftPressed = Keyboard::shiftPressed();
bool ctrlPressed = Keyboard::controlPressed();
bool shiftPressed = keyinfo.isKeyPressed(Qt::Key_Shift);
bool ctrlPressed = keyinfo.isKeyPressed(Qt::Key_Control);
bool modified = fromDrop && (shiftPressed || ctrlPressed);

if (modified) // Then no menu + modified action
Expand Down

0 comments on commit 0bd017a

Please sign in to comment.