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