[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kdevelop-bugs
Subject:    [Bug 248367] KDevelop krashes when trying to send patch to
From:       Aleix Pol <aleixpol () kde ! org>
Date:       2010-08-24 16:47:56
Message-ID: 20100824164757.3AA046218F () immanuel ! kde ! org
[Download RAW message or body]

https://bugs.kde.org/show_bug.cgi?id=248367


Aleix Pol <aleixpol@kde.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |FIXED




--- Comment #6 from Aleix Pol <aleixpol kde org>  2010-08-24 18:47:51 ---
commit 1628b17c8235575f3d4513d56f831f80dee5b248
Author: Aleix Pol <aleixpol@kde.org>
Date:   Tue Aug 24 17:45:20 2010 +0200

    Use the NewRequest job to fullfill the requests.

    BUG: 248367

diff --git a/plugins/reviewboard/reviewboardplugin.cpp
b/plugins/reviewboard/reviewboardplugin.cpp
index 83fe931..3d8efe0 100644
--- a/plugins/reviewboard/reviewboardplugin.cpp
+++ b/plugins/reviewboard/reviewboardplugin.cpp
@@ -38,6 +38,7 @@
 #include <vcs/interfaces/ibasicversioncontrol.h>
 #include <vcs/vcsjob.h>
 #include "reviewpatchdialog.h"
+#include "reviewboardjobs.h"

 using namespace KDevelop;

@@ -74,30 +75,29 @@ QByteArray urlToData(const KUrl& url)

 void ReviewBoardPlugin::exportPatch(IPatchSource::Ptr source)
 {
+    ReviewPatchDialog d;
+   
     IProject* p =
ICore::self()->projectController()->findProjectForUrl(source->baseDir());
-    KConfigGroup versionedConfig =
p->projectConfiguration()->group("ReviewBoard");

-    ReviewPatchDialog d;
-//     QString repo;
-//     if(versionedConfig.hasKey("repository"))
-//         repo = versionedConfig.readEntry("repository", QString());
-//     else if(p->versionControlPlugin()) {
-//         IBasicVersionControl* vcs =
p->versionControlPlugin()->extension<IBasicVersionControl>();
-//         VcsJob* job=vcs->repositoryLocation(p->folder());
-//         bool ret = job->exec();
-//         
-//         if(ret)
-//             repo = job->fetchResults().toString();
-//         delete job;
-//     }
-//     
-//     d.setRepository(repo);
-    d.setServer(versionedConfig.readEntry("server",
KUrl("http://reviewboard.kde.org")));
-    d.setUsername(versionedConfig.readEntry("username", QString()));
-//     d.setPatch(source->file());
+    if(p) {
+        KConfigGroup versionedConfig =
p->projectConfiguration()->group("ReviewBoard");
+    
+        d.setServer(versionedConfig.readEntry("server",
KUrl("http://reviewboard.kde.org")));
+        d.setUsername(versionedConfig.readEntry("username", QString()));
+    }

     int ret = d.exec();
     if(ret==KDialog::Accepted) {
-//         postReview(Service(ui.server->text(), ui.username->text(),
ui.password->text()), source->file());
+        ReviewBoard::NewRequest* job=new ReviewBoard::NewRequest(d.server(),
source->file(), d.baseDir());
+        bool corr = job->exec();
+        if(corr) {
+            KUrl url=d.server();
+            url.setUserInfo(QString());
+            QString requrl =
QString("%1/r/%2/").arg(url.prettyUrl()).arg(job->requestId());
+            
+            KMessageBox::information(0, i18n("<qt>You can find the new request
at:<br /><a href='%1'>%1</a> </qt>", requrl));
+        } else {
+            KMessageBox::error(0, job->errorText());
+        }
     }
 }

-- 
Configure bugmail: https://bugs.kde.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

_______________________________________________
KDevelop-bugs mailing list
KDevelop-bugs@kdevelop.org
https://barney.cs.uni-potsdam.de/mailman/listinfo/kdevelop-bugs
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic