# HG changeset patch # User insilmaril # Date 1262690592 0 # Node ID 735c7ea1d2a956ab9449e91359c158ae55384cbf # Parent 8f987e376035023b1dadc12d03ba27a3eb6039c8 Fixed dropping of URLs diff -r 8f987e376035 -r 735c7ea1d2a9 mainwindow.cpp --- a/mainwindow.cpp Mon Jan 04 20:36:06 2010 +0000 +++ b/mainwindow.cpp Tue Jan 05 11:23:12 2010 +0000 @@ -805,6 +805,16 @@ connect( a, SIGNAL( triggered() ), this, SLOT( editBugzilla2URL() ) ); actionBugzilla2URL=a; + a = new QAction(tr( "Create URL to Novell Bugzilla","Edit menu" ), this); + a->setStatusTip ( tr( "Get data from Novell Bugzilla" )); + a->setEnabled (false); + actionListBranches.append(a); + a->setShortcut ( Qt::Key_B + Qt::SHIFT); + a->setShortcutContext (Qt::WindowShortcut); + addAction(a); + connect( a, SIGNAL( triggered() ), this, SLOT( getBugzillaData() ) ); + actionGetBugzillaData=a; + a = new QAction(tr( "Create URL to Novell FATE","Edit menu" ), this); a->setStatusTip ( tr( "Create URL to Novell FATE" )); a->setEnabled (false); @@ -1621,6 +1631,7 @@ branchLinksContextMenu->addAction ( actionBugzilla2URL ); if (settings.value( "/mainwindow/showTestMenu",false).toBool() ) { + branchLinksContextMenu->addAction ( actionGetBugzillaData ); branchLinksContextMenu->addAction ( actionFATE2URL ); } branchLinksContextMenu->addSeparator(); @@ -2648,6 +2659,12 @@ if (m) m->editBugzilla2URL(); } +void Main::getBugzillaData() +{ + VymModel *m=currentModel(); + if (m) m->getBugzillaData(); +} + void Main::editFATE2URL() { VymModel *m=currentModel(); diff -r 8f987e376035 -r 735c7ea1d2a9 mainwindow.h --- a/mainwindow.h Mon Jan 04 20:36:06 2010 +0000 +++ b/mainwindow.h Tue Jan 05 11:23:12 2010 +0000 @@ -129,6 +129,7 @@ void editLocalURL(); void editHeading2URL(); void editBugzilla2URL(); + void getBugzillaData(); void editFATE2URL(); void openVymLinks(const QStringList &); void editVymLink(); @@ -294,6 +295,7 @@ QAction* actionLocalURL; QAction* actionHeading2URL; QAction* actionBugzilla2URL; + QAction* actionGetBugzillaData; QAction* actionFATE2URL; QAction *actionOpenVymLink; QAction *actionOpenMultipleVymLinks; diff -r 8f987e376035 -r 735c7ea1d2a9 mapeditor.cpp --- a/mapeditor.cpp Mon Jan 04 20:36:06 2010 +0000 +++ b/mapeditor.cpp Tue Jan 05 11:23:12 2010 +0000 @@ -1613,21 +1613,43 @@ if (selbi) { if (debug) + { foreach (QString format,event->mimeData()->formats()) cout << "MapEditor: Dropped format: "<mimeData()->urls()) + cout << " URL:"<mimeData()->text()) + // cout << " PLAIN:"<mimeData()->data("STRING"); + + QString s; + s=ba; + cout << " STRING:" <mimeData()->data("TEXT"); + s=ba; + cout << " TEXT:" < uris; + ba=event->mimeData()->data("COMPOUND_TEXT"); + s=ba; + cout << " CTEXT:" <mimeData()->data("text/x-moz-url"); + s=ba; + cout << " x-moz-url:" <setVymLink(file); + model->setVymLink(file); else - bi->setURL(uris.at(i).toString()); + model->setURL(uris.at(i).toString()); } else { - bo->setURL(uris.at(i).toString()); + model->setURL(uris.at(i).toString()); } - */ if (!heading.isEmpty()) - bi->setHeading(heading); + model->setHeading(heading); else - bi->setHeading(uris.at(i).toString()); + model->setHeading(uris.at(i).toString()); + model->select (bi->parent()); } } } - model->reposition(); + //model->reposition(); } } event->acceptProposedAction(); diff -r 8f987e376035 -r 735c7ea1d2a9 tex/vym.changelog --- a/tex/vym.changelog Mon Jan 04 20:36:06 2010 +0000 +++ b/tex/vym.changelog Tue Jan 05 11:23:12 2010 +0000 @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Tue Jan 5 12:22:27 CET 2010 - vym@insilmaril.de + +- Bugfix: Dropping URLs + ------------------------------------------------------------------- Mon Jan 4 09:36:24 CET 2010 - vym@insilmaril.de diff -r 8f987e376035 -r 735c7ea1d2a9 version.h --- a/version.h Mon Jan 04 20:36:06 2010 +0000 +++ b/version.h Tue Jan 05 11:23:12 2010 +0000 @@ -7,7 +7,7 @@ #define __VYM_VERSION "1.13.0" //#define __VYM_CODENAME "Codename: RC-1" #define __VYM_CODENAME "Codename: development version, not for production!" -#define __VYM_BUILD_DATE "2010-01-04" +#define __VYM_BUILD_DATE "2010-01-05" bool checkVersion(const QString &); diff -r 8f987e376035 -r 735c7ea1d2a9 vymmodel.cpp --- a/vymmodel.cpp Mon Jan 04 20:36:06 2010 +0000 +++ b/vymmodel.cpp Tue Jan 05 11:23:12 2010 +0000 @@ -2878,6 +2878,21 @@ } } +void VymModel::getBugzillaData() +{ + TreeItem *selti=getSelectedItem(); + if (selti) + { + QString url=selti->getURL(); + if (!url.isEmpty()) + { + QRegExp rx("(\\d+)"); + if (rx.indexIn(url) !=-1) + cout << "VM::getBugzillaData bug="<