Commit 2cb95148 authored by dt's avatar dt

Merge branch 'master' of scm.dev.nokia.troll.no:creator/mainline

parents 6b389129 ce8b7f97
......@@ -2,7 +2,7 @@
me=$(dirname $0)
for i in $QTDIR/src/declarative/qml/parser/*.{h,cpp,pri}; do
for i in $QTDIR/src/declarative/qml/parser/*.{g,h,cpp,pri}; do
sed -f $me/cmd.sed $i > $me/$(echo $(basename $i) | sed s/qdeclarativejs/qmljs/)
done
......
......@@ -65,6 +65,7 @@
%token T_PUBLIC "public"
%token T_IMPORT "import"
%token T_AS "as"
%token T_ON "on"
--- feed tokens
%token T_FEED_UI_PROGRAM
......@@ -653,18 +654,15 @@ case $rule_number: {
node = makeAstNode<AST::UiImport>(driver->nodePool(), importIdLiteral->value);
node->fileNameToken = loc(2);
} else if (AST::UiQualifiedId *qualifiedId = reparseAsQualifiedId(sym(2).Expression)) {
QString text;
for (AST::UiQualifiedId *q = qualifiedId; q; q = q->next) {
text += q->name->asString();
if (q->next) text += QLatin1String(".");
}
node = makeAstNode<AST::UiImport>(driver->nodePool(), qualifiedId);
node->fileNameToken = loc(2);
}
sym(1).Node = node;
if (! node) {
if (node) {
node->importToken = loc(1);
} else {
diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, loc(1),
QLatin1String("Expected a qualified name id or a string literal")));
......@@ -773,6 +771,17 @@ case $rule_number: {
} break;
./
UiObjectMember: UiQualifiedId T_ON UiQualifiedId UiObjectInitializer ;
/.
case $rule_number: {
AST::UiObjectBinding *node = makeAstNode<AST::UiObjectBinding> (driver->nodePool(),
sym(3).UiQualifiedId, sym(1).UiQualifiedId, sym(4).UiObjectInitializer);
node->colonToken = loc(2);
node->hasOnToken = true;
sym(1).Node = node;
} break;
./
UiObjectMember: UiQualifiedId T_COLON Block ;
/.case $rule_number:./
......@@ -870,8 +879,8 @@ case $rule_number: {
} break;
./
UiObjectMember: T_PROPERTY T_IDENTIFIER T_LT UiPropertyType T_GT T_IDENTIFIER T_AUTOMATIC_SEMICOLON ;
UiObjectMember: T_PROPERTY T_IDENTIFIER T_LT UiPropertyType T_GT T_IDENTIFIER T_SEMICOLON ;
UiObjectMember: T_PROPERTY T_IDENTIFIER T_LT UiPropertyType T_GT JsIdentifier T_AUTOMATIC_SEMICOLON ;
UiObjectMember: T_PROPERTY T_IDENTIFIER T_LT UiPropertyType T_GT JsIdentifier T_SEMICOLON ;
/.
case $rule_number: {
AST::UiPublicMember *node = makeAstNode<AST::UiPublicMember> (driver->nodePool(), sym(4).sval, sym(6).sval);
......@@ -885,8 +894,8 @@ case $rule_number: {
} break;
./
UiObjectMember: T_PROPERTY UiPropertyType T_IDENTIFIER T_AUTOMATIC_SEMICOLON ;
UiObjectMember: T_PROPERTY UiPropertyType T_IDENTIFIER T_SEMICOLON ;
UiObjectMember: T_PROPERTY UiPropertyType JsIdentifier T_AUTOMATIC_SEMICOLON ;
UiObjectMember: T_PROPERTY UiPropertyType JsIdentifier T_SEMICOLON ;
/.
case $rule_number: {
AST::UiPublicMember *node = makeAstNode<AST::UiPublicMember> (driver->nodePool(), sym(2).sval, sym(3).sval);
......@@ -898,8 +907,8 @@ case $rule_number: {
} break;
./
UiObjectMember: T_DEFAULT T_PROPERTY UiPropertyType T_IDENTIFIER T_AUTOMATIC_SEMICOLON ;
UiObjectMember: T_DEFAULT T_PROPERTY UiPropertyType T_IDENTIFIER T_SEMICOLON ;
UiObjectMember: T_DEFAULT T_PROPERTY UiPropertyType JsIdentifier T_AUTOMATIC_SEMICOLON ;
UiObjectMember: T_DEFAULT T_PROPERTY UiPropertyType JsIdentifier T_SEMICOLON ;
/.
case $rule_number: {
AST::UiPublicMember *node = makeAstNode<AST::UiPublicMember> (driver->nodePool(), sym(3).sval, sym(4).sval);
......@@ -913,8 +922,8 @@ case $rule_number: {
} break;
./
UiObjectMember: T_PROPERTY UiPropertyType T_IDENTIFIER T_COLON Expression T_AUTOMATIC_SEMICOLON ;
UiObjectMember: T_PROPERTY UiPropertyType T_IDENTIFIER T_COLON Expression T_SEMICOLON ;
UiObjectMember: T_PROPERTY UiPropertyType JsIdentifier T_COLON Expression T_AUTOMATIC_SEMICOLON ;
UiObjectMember: T_PROPERTY UiPropertyType JsIdentifier T_COLON Expression T_SEMICOLON ;
/.
case $rule_number: {
AST::UiPublicMember *node = makeAstNode<AST::UiPublicMember> (driver->nodePool(), sym(2).sval, sym(3).sval,
......@@ -928,8 +937,8 @@ case $rule_number: {
} break;
./
UiObjectMember: T_READONLY T_PROPERTY UiPropertyType T_IDENTIFIER T_COLON Expression T_AUTOMATIC_SEMICOLON ;
UiObjectMember: T_READONLY T_PROPERTY UiPropertyType T_IDENTIFIER T_COLON Expression T_SEMICOLON ;
UiObjectMember: T_READONLY T_PROPERTY UiPropertyType JsIdentifier T_COLON Expression T_AUTOMATIC_SEMICOLON ;
UiObjectMember: T_READONLY T_PROPERTY UiPropertyType JsIdentifier T_COLON Expression T_SEMICOLON ;
/.
case $rule_number: {
AST::UiPublicMember *node = makeAstNode<AST::UiPublicMember> (driver->nodePool(), sym(3).sval, sym(4).sval,
......@@ -945,8 +954,8 @@ case $rule_number: {
} break;
./
UiObjectMember: T_DEFAULT T_PROPERTY UiPropertyType T_IDENTIFIER T_COLON Expression T_AUTOMATIC_SEMICOLON ;
UiObjectMember: T_DEFAULT T_PROPERTY UiPropertyType T_IDENTIFIER T_COLON Expression T_SEMICOLON ;
UiObjectMember: T_DEFAULT T_PROPERTY UiPropertyType JsIdentifier T_COLON Expression T_AUTOMATIC_SEMICOLON ;
UiObjectMember: T_DEFAULT T_PROPERTY UiPropertyType JsIdentifier T_COLON Expression T_SEMICOLON ;
/.
case $rule_number: {
AST::UiPublicMember *node = makeAstNode<AST::UiPublicMember> (driver->nodePool(), sym(3).sval, sym(4).sval,
......@@ -1005,6 +1014,15 @@ case $rule_number: {
}
./
JsIdentifier: T_ON ;
/.
case $rule_number: {
QString s = QLatin1String(QmlJSGrammar::spell[T_ON]);
sym(1).sval = driver->intern(s.constData(), s.length());
break;
}
./
--------------------------------------------------------------------------------------------------------
-- Expressions
--------------------------------------------------------------------------------------------------------
......@@ -1086,6 +1104,9 @@ case $rule_number: {
diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, location(lexer), lexer->errorMessage()));
return false; // ### remove me
}
loc(1).length = lexer->tokenLength();
AST::RegExpLiteral *node = makeAstNode<AST::RegExpLiteral> (driver->nodePool(), lexer->pattern, lexer->flags);
node->literalToken = loc(1);
sym(1).Node = node;
......@@ -1103,6 +1124,9 @@ case $rule_number: {
diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, location(lexer), lexer->errorMessage()));
return false;
}
loc(1).length = lexer->tokenLength();
AST::RegExpLiteral *node = makeAstNode<AST::RegExpLiteral> (driver->nodePool(), lexer->pattern, lexer->flags);
node->literalToken = loc(1);
sym(1).Node = node;
......
......@@ -273,11 +273,6 @@ case 20: {
node = makeAstNode<AST::UiImport>(driver->nodePool(), importIdLiteral->value);
node->fileNameToken = loc(2);
} else if (AST::UiQualifiedId *qualifiedId = reparseAsQualifiedId(sym(2).Expression)) {
QString text;
for (AST::UiQualifiedId *q = qualifiedId; q; q = q->next) {
text += q->name->asString();
if (q->next) text += QLatin1String(".");
}
node = makeAstNode<AST::UiImport>(driver->nodePool(), qualifiedId);
node->fileNameToken = loc(2);
}
......@@ -571,6 +566,9 @@ case 76: {
diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, location(lexer), lexer->errorMessage()));
return false; // ### remove me
}
loc(1).length = lexer->tokenLength();
AST::RegExpLiteral *node = makeAstNode<AST::RegExpLiteral> (driver->nodePool(), lexer->pattern, lexer->flags);
node->literalToken = loc(1);
sym(1).Node = node;
......@@ -582,6 +580,9 @@ case 77: {
diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, location(lexer), lexer->errorMessage()));
return false;
}
loc(1).length = lexer->tokenLength();
AST::RegExpLiteral *node = makeAstNode<AST::RegExpLiteral> (driver->nodePool(), lexer->pattern, lexer->flags);
node->literalToken = loc(1);
sym(1).Node = node;
......
......@@ -290,8 +290,8 @@ public:
WizardProgress *m_wizardProgress;
};
Wizard::Wizard(QWidget *parent) :
QWizard(parent), d_ptr(new WizardPrivate)
Wizard::Wizard(QWidget *parent, Qt::WindowFlags flags) :
QWizard(parent, flags), d_ptr(new WizardPrivate)
{
d_ptr->q_ptr = this;
d_ptr->m_wizardProgress = new WizardProgress(this);
......@@ -301,6 +301,11 @@ Wizard::Wizard(QWidget *parent) :
setSideWidget(new LinearProgressWidget(d_ptr->m_wizardProgress, this));
}
Wizard::~Wizard()
{
delete d_ptr;
}
bool Wizard::isAutomaticProgressCreationEnabled() const
{
Q_D(const Wizard);
......@@ -563,6 +568,7 @@ WizardProgress::~WizardProgress()
delete it.key();
++it;
}
delete d_ptr;
}
WizardProgressItem *WizardProgress::addItem(const QString &title)
......@@ -764,7 +770,7 @@ WizardProgressItem::WizardProgressItem(WizardProgress *progress, const QString &
WizardProgressItem::~WizardProgressItem()
{
delete d_ptr;
}
void WizardProgressItem::addPage(int pageId)
......
......@@ -47,7 +47,8 @@ class QTCREATOR_UTILS_EXPORT Wizard : public QWizard
Q_PROPERTY(bool automaticProgressCreationEnabled READ isAutomaticProgressCreationEnabled WRITE setAutomaticProgressCreationEnabled)
public:
explicit Wizard(QWidget *parent = 0);
explicit Wizard(QWidget *parent = 0, Qt::WindowFlags flags = 0);
virtual ~Wizard();
bool isAutomaticProgressCreationEnabled() const;
void setAutomaticProgressCreationEnabled(bool enabled);
......@@ -66,7 +67,7 @@ private:
Q_DISABLE_COPY(Wizard)
Q_DECLARE_PRIVATE(Wizard)
QScopedPointer<WizardPrivate> d_ptr;
class WizardPrivate *d_ptr;
};
class WizardProgressItem;
......@@ -118,7 +119,7 @@ private:
Q_DISABLE_COPY(WizardProgress)
Q_DECLARE_PRIVATE(WizardProgress)
QScopedPointer<WizardProgressPrivate> d_ptr;
class WizardProgressPrivate *d_ptr;
};
class WizardProgressItemPrivate;
......@@ -150,7 +151,7 @@ private:
Q_DISABLE_COPY(WizardProgressItem)
Q_DECLARE_PRIVATE(WizardProgressItem)
QScopedPointer<WizardProgressItemPrivate> d_ptr;
class WizardProgressItemPrivate *d_ptr;
};
} // namespace Utils
......
......@@ -64,7 +64,8 @@ namespace Internal {
// ----------- Category model
struct Category {
class Category {
public:
QString id;
QString displayName;
QIcon icon;
......
......@@ -75,7 +75,6 @@ namespace Core {
EditorToolBar::EditorToolBar(QWidget *parent) :
Utils::StyledBar(parent),
m_editorList(new QComboBox(this)),
m_rightToolBar(new QToolBar(this)),
m_closeButton(new QToolButton),
m_lockButton(new QToolButton),
......@@ -124,10 +123,6 @@ EditorToolBar::EditorToolBar(QWidget *parent) :
m_forwardButton= new QToolButton(this);
m_forwardButton->setDefaultAction(m_goForwardAction);
m_rightToolBar->setLayoutDirection(Qt::RightToLeft);
m_rightToolBar->addWidget(m_closeButton);
m_rightToolBar->addWidget(m_lockButton);
QHBoxLayout *toplayout = new QHBoxLayout(this);
toplayout->setSpacing(0);
toplayout->setMargin(0);
......@@ -135,7 +130,8 @@ EditorToolBar::EditorToolBar(QWidget *parent) :
toplayout->addWidget(m_forwardButton);
toplayout->addWidget(m_editorList);
toplayout->addWidget(m_toolBarPlaceholder, 1); // Custom toolbar stretches
toplayout->addWidget(m_rightToolBar);
toplayout->addWidget(m_lockButton);
toplayout->addWidget(m_closeButton);
setLayout(toplayout);
......
......@@ -111,8 +111,6 @@ private:
IEditor *currentEditor() const;
Core::OpenEditorsModel *m_editorsListModel;
QComboBox *m_editorList;
QToolBar *m_centerToolBar;
QToolBar *m_rightToolBar;
QToolButton *m_closeButton;
QToolButton *m_lockButton;
QAction *m_goBackAction;
......
......@@ -264,31 +264,8 @@ FancyActionBar::FancyActionBar(QWidget *parent)
spacerLayout->setSpacing(0);
setLayout(spacerLayout);
setContentsMargins(0,2,0,0);
m_runButton = m_debugButton = 0;
m_inDebugMode = false;
connect(Core::ModeManager::instance(), SIGNAL(currentModeChanged(Core::IMode*)),
this, SLOT(modeChanged(Core::IMode*)));
#ifdef Q_WS_MAC
qApp->installEventFilter(this);
#endif
}
#ifdef Q_WS_MAC
bool FancyActionBar::eventFilter(QObject *, QEvent *e)
{
if (e->type() == QEvent::KeyPress || e->type() == QEvent::KeyRelease) {
if (static_cast<QKeyEvent *>(e)->key() == Qt::Key_Alt)
updateRunDebug();
} else if (e->type() == QEvent::WindowDeactivate)
updateRunDebug();
return false;
}
#endif
void FancyActionBar::addProjectSelector(QAction *action)
{
FancyToolButton* toolButton = new FancyToolButton(this);
......@@ -300,40 +277,11 @@ void FancyActionBar::addProjectSelector(QAction *action)
void FancyActionBar::insertAction(int index, QAction *action)
{
FancyToolButton *toolButton = new FancyToolButton(this);
if (action->objectName() == QLatin1String("ProjectExplorer.Run"))
m_runButton = toolButton;
if (action->objectName() == QLatin1String("ProjectExplorer.Debug"))
m_debugButton = toolButton;
toolButton->setDefaultAction(action);
connect(action, SIGNAL(changed()), toolButton, SLOT(actionChanged()));
m_actionsLayout->insertWidget(index, toolButton);
}
void FancyActionBar::modeChanged(Core::IMode *mode)
{
m_inDebugMode = (mode->id() == QLatin1String("Debugger.Mode.Debug"));
updateRunDebug();
}
void FancyActionBar::updateRunDebug()
{
if (!m_runButton || !m_debugButton)
return;
bool doDebug = m_inDebugMode;
#ifdef Q_WS_MAC
if (QApplication::keyboardModifiers() && Qt::AltModifier)
doDebug = !doDebug;
#endif
layout()->setEnabled(false);
m_runButton->forceVisible(!doDebug);
m_debugButton->forceVisible(doDebug);
layout()->setEnabled(true);
}
QLayout *FancyActionBar::actionsLayout() const
{
return m_actionsLayout;
......
......@@ -75,23 +75,13 @@ class FancyActionBar : public QWidget
public:
FancyActionBar(QWidget *parent = 0);
#ifdef Q_WS_MAC
bool eventFilter(QObject *, QEvent *);
#endif
void paintEvent(QPaintEvent *event);
void insertAction(int index, QAction *action);
void addProjectSelector(QAction *action);
QLayout *actionsLayout() const;
private slots:
void modeChanged(Core::IMode *mode);
private:
void updateRunDebug();
bool m_inDebugMode;
QVBoxLayout *m_actionsLayout;
FancyToolButton *m_runButton;
FancyToolButton *m_debugButton;
};
} // namespace Internal
......
......@@ -48,7 +48,8 @@ enum { debug = 0 };
namespace CodePaster {
CodePasterProtocol::CodePasterProtocol() :
CodePasterProtocol::CodePasterProtocol(const NetworkAccessManagerProxyPtr &nw) :
NetworkProtocol(nw),
m_page(new CodePaster::CodePasterSettingsPage),
m_pasteReply(0),
m_fetchReply(0),
......@@ -98,10 +99,7 @@ void CodePasterProtocol::fetch(const QString &id)
link.append(hostName);
link.append("/?format=raw&id=");
link.append(id);
QUrl url(link);
QNetworkRequest r(url);
m_fetchReply = m_manager.get(r);
m_fetchReply = httpGet(link);
connect(m_fetchReply, SIGNAL(finished()), this, SLOT(fetchFinished()));
m_fetchId = id;
}
......@@ -116,9 +114,7 @@ void CodePasterProtocol::list()
QString link = QLatin1String("http://");
link += hostName;
link += QLatin1String("/?command=browse&format=raw");
QUrl url(link);
QNetworkRequest r(url);
m_listReply = m_manager.get(r);
m_listReply = httpGet(link);
connect(m_listReply, SIGNAL(finished()), this, SLOT(listFinished()));
}
......@@ -142,9 +138,7 @@ void CodePasterProtocol::paste(const QString &text,
data += "&poster=";
data += CGI::encodeURL(username).toLatin1();
QUrl url(QLatin1String("http://") + hostName);
QNetworkRequest r(url);
m_pasteReply = m_manager.post(r, data);
m_pasteReply = httpPost(QLatin1String("http://") + hostName, data);
connect(m_pasteReply, SIGNAL(finished()), this, SLOT(pasteFinished()));
}
......
......@@ -32,8 +32,6 @@
#include "protocol.h"
#include <QtNetwork/QNetworkAccessManager>
QT_BEGIN_NAMESPACE
class QNetworkReply;
QT_END_NAMESPACE
......@@ -42,11 +40,11 @@ namespace CodePaster {
class CodePasterSettingsPage;
class CodePasterProtocol : public Protocol
class CodePasterProtocol : public NetworkProtocol
{
Q_OBJECT
public:
CodePasterProtocol();
explicit CodePasterProtocol(const NetworkAccessManagerProxyPtr &nw);
~CodePasterProtocol();
QString name() const;
......@@ -70,7 +68,6 @@ public slots:
private:
bool isValidHostName(const QString& hostName);
CodePasterSettingsPage *m_page;
QNetworkAccessManager m_manager;
QNetworkReply *m_pasteReply;
QNetworkReply *m_fetchReply;
QNetworkReply *m_listReply;
......
......@@ -65,7 +65,9 @@ using namespace CodePaster;
using namespace Core;
using namespace TextEditor;
CodepasterPlugin::CodepasterPlugin() : m_settings(new Settings)
CodepasterPlugin::CodepasterPlugin() :
m_settings(new Settings),
m_postEditorAction(0), m_postClipboardAction(0), m_fetchAction(0)
{
}
......@@ -89,9 +91,10 @@ bool CodepasterPlugin::initialize(const QStringList &arguments, QString *error_m
addAutoReleasedObject(settingsPage);
// Create the protocols and append them to the Settings
Protocol *protos[] = { new CodePasterProtocol(),
new PasteBinDotComProtocol(),
new PasteBinDotCaProtocol(),
const QSharedPointer<NetworkAccessManagerProxy> networkAccessMgrProxy(new NetworkAccessManagerProxy);
Protocol *protos[] = { new CodePasterProtocol(networkAccessMgrProxy),
new PasteBinDotComProtocol(networkAccessMgrProxy),
new PasteBinDotCaProtocol(networkAccessMgrProxy),
0};
for(int i=0; protos[i] != 0; ++i) {
connect(protos[i], SIGNAL(pasteDone(QString)), this, SLOT(finishPost(QString)));
......@@ -116,10 +119,15 @@ bool CodepasterPlugin::initialize(const QStringList &arguments, QString *error_m
Core::Command *command;
m_postAction = new QAction(tr("Paste Snippet..."), this);
command = actionManager->registerAction(m_postAction, "CodePaster.Post", globalcontext);
m_postEditorAction = new QAction(tr("Paste Snippet..."), this);
command = actionManager->registerAction(m_postEditorAction, "CodePaster.Post", globalcontext);
command->setDefaultKeySequence(QKeySequence(tr("Alt+C,Alt+P")));
connect(m_postAction, SIGNAL(triggered()), this, SLOT(post()));
connect(m_postEditorAction, SIGNAL(triggered()), this, SLOT(postEditor()));
cpContainer->addAction(command);
m_postClipboardAction = new QAction(tr("Paste Clipboard..."), this);
command = actionManager->registerAction(m_postClipboardAction, "CodePaster.PostClipboard", globalcontext);
connect(m_postClipboardAction, SIGNAL(triggered()), this, SLOT(postClipboard()));
cpContainer->addAction(command);
m_fetchAction = new QAction(tr("Fetch Snippet..."), this);
......@@ -145,6 +153,28 @@ void CodepasterPlugin::shutdown()
}
}
void CodepasterPlugin::postEditor()
{
const IEditor* editor = EditorManager::instance()->currentEditor();
const BaseTextEditorEditable *textEditor = qobject_cast<const BaseTextEditorEditable *>(editor);
if (!textEditor)
return;
QString data = textEditor->selectedText();
if (data.isEmpty())
data = textEditor->contents();
if (!data.isEmpty())
post(data, textEditor->editor()->mimeType());
}
void CodepasterPlugin::postClipboard()
{
QString subtype = QLatin1String("plain");
const QString text = qApp->clipboard()->text(subtype, QClipboard::Clipboard);
if (!text.isEmpty())
post(text, QString());
}
static inline void fixSpecialCharacters(QString &data)
{
QChar *uc = data.data();
......@@ -167,18 +197,8 @@ static inline void fixSpecialCharacters(QString &data)
}
}
void CodepasterPlugin::post()
void CodepasterPlugin::post(QString data, const QString &mimeType)
{
const IEditor* editor = EditorManager::instance()->currentEditor();
const BaseTextEditorEditable *textEditor = qobject_cast<const BaseTextEditorEditable *>(editor);
if (!textEditor)
return;
QString data = textEditor->selectedText();
if (data.isEmpty())
data = textEditor->contents();
if (data.isEmpty())
return;
fixSpecialCharacters(data);
FileDataList lst = splitDiffToFiles(data.toLatin1());
QString username = m_settings->username;
......@@ -199,7 +219,7 @@ void CodepasterPlugin::post()
protocolName = view.protocol();
foreach(Protocol *protocol, m_protocols) {
if (protocol->name() == protocolName) {
const Protocol::ContentType ct = Protocol::contentType(textEditor->editor()->mimeType());
const Protocol::ContentType ct = Protocol::contentType(mimeType);
protocol->paste(data, ct, username, comment, description);
break;
}
......
......@@ -58,7 +58,8 @@ public:
virtual void shutdown();
public slots:
void post();
void postEditor();
void postClipboard();
void fetch();
void finishPost(const QString &link);
void finishFetch(const QString &titleDescription,
......@@ -66,8 +67,11 @@ public slots:
bool error);
private:
void post(QString data, const QString &mimeType);
const QSharedPointer<Settings> m_settings;
QAction *m_postAction;
QAction *m_postEditorAction;
QAction *m_postClipboardAction;
QAction *m_fetchAction;
QList<Protocol*> m_protocols;
QStringList m_fetchedSnippets;
......
......@@ -32,11 +32,13 @@
#include <QtNetwork/QNetworkReply>
using namespace Core;
namespace CodePaster {
PasteBinDotCaProtocol::PasteBinDotCaProtocol()
PasteBinDotCaProtocol::PasteBinDotCaProtocol(const NetworkAccessManagerProxyPtr &nw) :
NetworkProtocol(nw),
m_fetchReply(0),
m_postId(-1)
{
connect(&http, SIGNAL(requestFinished(int,bool)),
connect(&m_http, SIGNAL(requestFinished(int,bool)),
this, SLOT(postRequestFinished(int,bool)));
}
......@@ -44,12 +46,9 @@ void PasteBinDotCaProtocol::fetch(const QString &id)
{
QString link = QLatin1String("http://pastebin.ca/raw/");
link.append(id);
QUrl url(link);
QNetworkRequest r(url);
reply = manager.get(r);