summaryrefslogtreecommitdiffstats
path: root/src/core/drophandler.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-07-02 06:40:27 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-07-02 06:40:27 +0000
commit2595a15ebeb6fc46b7cb241d01ec0c2460ec2111 (patch)
tree18a8f0f4ac5a86dacfa74c3537551ec39bc85e75 /src/core/drophandler.cpp
parent1d90725a4001fab9d3922b2cbcceeee5e2d1686f (diff)
downloadtellico-2595a15ebeb6fc46b7cb241d01ec0c2460ec2111.tar.gz
tellico-2595a15ebeb6fc46b7cb241d01ec0c2460ec2111.zip
TQt4 port tellico
This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/tellico@1239054 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'src/core/drophandler.cpp')
-rw-r--r--src/core/drophandler.cpp34
1 files changed, 17 insertions, 17 deletions
diff --git a/src/core/drophandler.cpp b/src/core/drophandler.cpp
index e27df9d..6deb2e1 100644
--- a/src/core/drophandler.cpp
+++ b/src/core/drophandler.cpp
@@ -21,7 +21,7 @@
using Tellico::DropHandler;
-DropHandler::DropHandler(QObject* parent_) : QObject(parent_) {
+DropHandler::DropHandler(TQObject* tqparent_) : TQObject(tqparent_) {
}
DropHandler::~DropHandler() {
@@ -29,30 +29,30 @@ DropHandler::~DropHandler() {
// assume the object is always the main window, that's the
// only object with this event filter
-bool DropHandler::eventFilter(QObject* obj_, QEvent* ev_) {
+bool DropHandler::eventFilter(TQObject* obj_, TQEvent* ev_) {
Q_UNUSED(obj_);
- if(ev_->type() == QEvent::DragEnter) {
- return dragEnter(static_cast<QDragEnterEvent*>(ev_));
- } else if(ev_->type() == QEvent::Drop) {
- return drop(static_cast<QDropEvent*>(ev_));
+ if(ev_->type() == TQEvent::DragEnter) {
+ return dragEnter(static_cast<TQDragEnterEvent*>(ev_));
+ } else if(ev_->type() == TQEvent::Drop) {
+ return drop(static_cast<TQDropEvent*>(ev_));
}
return false;
}
-bool DropHandler::dragEnter(QDragEnterEvent* event_) {
- bool accept = KURLDrag::canDecode(event_) || QTextDrag::canDecode(event_);
+bool DropHandler::dragEnter(TQDragEnterEvent* event_) {
+ bool accept = KURLDrag::canDecode(event_) || TQTextDrag::canDecode(event_);
if(accept) {
event_->accept(accept);
}
return accept;
}
-bool DropHandler::drop(QDropEvent* event_) {
+bool DropHandler::drop(TQDropEvent* event_) {
KURL::List urls;
- QString text;
+ TQString text;
if(KURLDrag::decode(event_, urls)) {
- } else if(QTextDrag::decode(event_, text) && !text.isEmpty()) {
+ } else if(TQTextDrag::decode(event_, text) && !text.isEmpty()) {
urls << KURL(text);
}
return !urls.isEmpty() && handleURL(urls);
@@ -63,21 +63,21 @@ bool DropHandler::handleURL(const KURL::List& urls_) {
KURL::List tc, pdf, bib, ris;
for(KURL::List::ConstIterator it = urls_.begin(); it != urls_.end(); ++it) {
KMimeType::Ptr ptr = KMimeType::findByURL(*it);
- if(ptr->is(QString::fromLatin1("application/x-tellico"))) {
+ if(ptr->is(TQString::tqfromLatin1("application/x-tellico"))) {
tc << *it;
- } else if(ptr->is(QString::fromLatin1("application/pdf"))) {
+ } else if(ptr->is(TQString::tqfromLatin1("application/pdf"))) {
pdf << *it;
- } else if(ptr->is(QString::fromLatin1("text/x-bibtex")) ||
- ptr->is(QString::fromLatin1("application/x-bibtex"))) {
+ } else if(ptr->is(TQString::tqfromLatin1("text/x-bibtex")) ||
+ ptr->is(TQString::tqfromLatin1("application/x-bibtex"))) {
bib << *it;
- } else if(ptr->is(QString::fromLatin1("application/x-research-info-systems"))) {
+ } else if(ptr->is(TQString::tqfromLatin1("application/x-research-info-systems"))) {
ris << *it;
} else {
myDebug() << "DropHandler::handleURL() - unrecognized type: " << ptr->name() << " (" << *it << ")" << endl;
hasUnknown = true;
}
}
- MainWindow* mainWindow = ::qt_cast<MainWindow*>(Kernel::self()->widget());
+ MainWindow* mainWindow = ::tqqt_cast<MainWindow*>(Kernel::self()->widget());
if(!mainWindow) {
myDebug() << "DropHandler::handleURL() - no main window!" << endl;
return !hasUnknown;