forked from qt-creator/qt-creator
cpaster: compile fix for namespaced qt plus code cosmetics
QListWidget forward declaration was not namespaced.
This commit is contained in:
@@ -29,6 +29,7 @@
|
||||
|
||||
#ifndef CODEPASTERPROTOCOL_H
|
||||
#define CODEPASTERPROTOCOL_H
|
||||
|
||||
#include "protocol.h"
|
||||
|
||||
#include <QtGui/QListWidget>
|
||||
@@ -56,9 +57,9 @@ public:
|
||||
void fetch(const QString &id);
|
||||
void list(QListWidget *listWidget);
|
||||
void paste(const QString &text,
|
||||
const QString &username = "",
|
||||
const QString &comment = "",
|
||||
const QString &description = "");
|
||||
const QString &username = QString(),
|
||||
const QString &comment = QString(),
|
||||
const QString &description = QString());
|
||||
public slots:
|
||||
void fetchFinished();
|
||||
void listFinished();
|
||||
@@ -74,5 +75,6 @@ private:
|
||||
QString fetchId;
|
||||
};
|
||||
|
||||
}
|
||||
} // namespace CodePaster
|
||||
|
||||
#endif // CODEPASTERPROTOCOL_H
|
||||
|
@@ -178,11 +178,11 @@ void CodepasterPlugin::post()
|
||||
if (!view.show(username, description, comment, lst))
|
||||
return; // User canceled post
|
||||
|
||||
username = view.getUser();
|
||||
description = view.getDescription();
|
||||
comment = view.getComment();
|
||||
data = view.getContent();
|
||||
protocolName = view.getProtocol();
|
||||
username = view.user();
|
||||
description = view.description();
|
||||
comment = view.comment();
|
||||
data = view.content();
|
||||
protocolName = view.protocol();
|
||||
|
||||
// Copied from cpaster. Otherwise lineendings will screw up
|
||||
if (!data.contains("\r\n")) {
|
||||
|
@@ -29,7 +29,9 @@
|
||||
|
||||
#ifndef PASTEBINDOTCAPROTOCOL_H
|
||||
#define PASTEBINDOTCAPROTOCOL_H
|
||||
|
||||
#include "protocol.h"
|
||||
|
||||
#include <QtNetwork/QNetworkAccessManager>
|
||||
#include <QtNetwork/QNetworkReply>
|
||||
#include <QtNetwork/QHttp>
|
||||
@@ -46,9 +48,9 @@ public:
|
||||
|
||||
void fetch(const QString &id);
|
||||
void paste(const QString &text,
|
||||
const QString &username = "",
|
||||
const QString &comment = "",
|
||||
const QString &description = "");
|
||||
const QString &username = QString(),
|
||||
const QString &comment = QString(),
|
||||
const QString &description = QString());
|
||||
public slots:
|
||||
void fetchFinished();
|
||||
|
||||
|
@@ -29,7 +29,9 @@
|
||||
|
||||
#ifndef PASTEBINDOTCOMPROTOCOL_H
|
||||
#define PASTEBINDOTCOMPROTOCOL_H
|
||||
|
||||
#include "protocol.h"
|
||||
|
||||
#include <QtNetwork/QNetworkAccessManager>
|
||||
#include <QtNetwork/QNetworkReply>
|
||||
#include <QtNetwork/QHttp>
|
||||
@@ -51,9 +53,9 @@ public:
|
||||
|
||||
void fetch(const QString &id);
|
||||
void paste(const QString &text,
|
||||
const QString &username = "",
|
||||
const QString &comment = "",
|
||||
const QString &description = "");
|
||||
const QString &username = QString(),
|
||||
const QString &comment = QString(),
|
||||
const QString &description = QString());
|
||||
public slots:
|
||||
void fetchFinished();
|
||||
|
||||
|
@@ -94,7 +94,7 @@ PasteView::~PasteView()
|
||||
{
|
||||
}
|
||||
|
||||
QString PasteView::getUser()
|
||||
QString PasteView::user() const
|
||||
{
|
||||
const QString username = m_ui.uiUsername->text();
|
||||
if (username.isEmpty() || username == tr("<Username>"))
|
||||
@@ -102,7 +102,7 @@ QString PasteView::getUser()
|
||||
return username;
|
||||
}
|
||||
|
||||
QString PasteView::getDescription()
|
||||
QString PasteView::description() const
|
||||
{
|
||||
const QString description = m_ui.uiDescription->text();
|
||||
if (description == tr("<Description>"))
|
||||
@@ -110,7 +110,7 @@ QString PasteView::getDescription()
|
||||
return description;
|
||||
}
|
||||
|
||||
QString PasteView::getComment()
|
||||
QString PasteView::comment() const
|
||||
{
|
||||
const QString comment = m_ui.uiComment->toPlainText();
|
||||
if (comment == tr("<Comment>"))
|
||||
@@ -118,7 +118,7 @@ QString PasteView::getComment()
|
||||
return comment;
|
||||
}
|
||||
|
||||
QByteArray PasteView::getContent()
|
||||
QByteArray PasteView::content() const
|
||||
{
|
||||
QByteArray newContent;
|
||||
for (int i = 0; i < m_ui.uiPatchList->count(); ++i) {
|
||||
@@ -129,14 +129,14 @@ QByteArray PasteView::getContent()
|
||||
return newContent;
|
||||
}
|
||||
|
||||
QString PasteView::getProtocol()
|
||||
QString PasteView::protocol() const
|
||||
{
|
||||
return m_ui.protocolBox->currentText();
|
||||
}
|
||||
|
||||
void PasteView::contentChanged()
|
||||
{
|
||||
m_ui.uiPatchView->setPlainText(getContent());
|
||||
m_ui.uiPatchView->setPlainText(content());
|
||||
}
|
||||
|
||||
int PasteView::show(const QString &user, const QString &description, const QString &comment,
|
||||
|
@@ -30,12 +30,12 @@
|
||||
#ifndef PASTEVIEW_H
|
||||
#define PASTEVIEW_H
|
||||
|
||||
#include <QDialog>
|
||||
#include <QByteArray>
|
||||
|
||||
#include "splitter.h"
|
||||
#include "ui_pasteview.h"
|
||||
|
||||
#include <QDialog>
|
||||
#include <QByteArray>
|
||||
|
||||
class PasteView : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
@@ -48,11 +48,11 @@ public:
|
||||
|
||||
void addProtocol(const QString &protocol, bool defaultProtocol = false);
|
||||
|
||||
QString getUser();
|
||||
QString getDescription();
|
||||
QString getComment();
|
||||
QByteArray getContent();
|
||||
QString getProtocol();
|
||||
QString user() const;
|
||||
QString description() const;
|
||||
QString comment() const;
|
||||
QByteArray content() const;
|
||||
QString protocol() const;
|
||||
|
||||
private slots:
|
||||
void contentChanged();
|
||||
|
@@ -26,8 +26,10 @@
|
||||
** contact the sales department at http://www.qtsoftware.com/contact.
|
||||
**
|
||||
**************************************************************************/
|
||||
|
||||
#ifndef PROTOCOL_H
|
||||
#define PROTOCOL_H
|
||||
|
||||
#include "settingspage.h"
|
||||
|
||||
#include <coreplugin/dialogs/ioptionspage.h>
|
||||
@@ -35,7 +37,9 @@
|
||||
#include <QtCore/QObject>
|
||||
#include <QtCore/QString>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
class QListWidget;
|
||||
QT_END_NAMESPACE
|
||||
|
||||
class Protocol : public QObject
|
||||
{
|
||||
@@ -55,9 +59,9 @@ public:
|
||||
virtual void fetch(const QString &id) = 0;
|
||||
virtual void list(QListWidget *listWidget);
|
||||
virtual void paste(const QString &text,
|
||||
const QString &username = "",
|
||||
const QString &comment = "",
|
||||
const QString &description = "") = 0;
|
||||
const QString &username = QString(),
|
||||
const QString &comment = QString(),
|
||||
const QString &description = QString()) = 0;
|
||||
|
||||
signals:
|
||||
void pasteDone(const QString &link);
|
||||
|
Reference in New Issue
Block a user