forked from qt-creator/qt-creator
CodePaster: Remove "make public" property
It's not functional in any of our implementations. Task-number: QTCREATORBUG-23972 Change-Id: I7c35b548e6069ff31e9a050752cd8267ce8ed7a8 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Christian Stenger <christian.stenger@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
@@ -59,9 +59,6 @@
|
|||||||
\li Select the \uicontrol {Display Output pane after sending a post}
|
\li Select the \uicontrol {Display Output pane after sending a post}
|
||||||
check box to display the URL in the \uicontrol {General Messages}
|
check box to display the URL in the \uicontrol {General Messages}
|
||||||
output pane when you paste a post.
|
output pane when you paste a post.
|
||||||
\li Select the \uicontrol {Make pasted content public by default}
|
|
||||||
check box to make the posted URL get listed on the service's website,
|
|
||||||
rather than only being available via the direct link.
|
|
||||||
\endlist
|
\endlist
|
||||||
|
|
||||||
Select \uicontrol Fileshare to specify the path to a shared network drive.
|
Select \uicontrol Fileshare to specify the path to a shared network drive.
|
||||||
|
@@ -274,8 +274,8 @@ void CodePasterPluginPrivate::post(QString data, const QString &mimeType)
|
|||||||
|
|
||||||
const FileDataList diffChunks = splitDiffToFiles(data);
|
const FileDataList diffChunks = splitDiffToFiles(data);
|
||||||
const int dialogResult = diffChunks.isEmpty() ?
|
const int dialogResult = diffChunks.isEmpty() ?
|
||||||
view.show(username, {}, {}, m_settings.expiryDays.value(), m_settings.publicPaste.value(), data) :
|
view.show(username, {}, {}, m_settings.expiryDays.value(), data) :
|
||||||
view.show(username, {}, {}, m_settings.expiryDays.value(), m_settings.publicPaste.value(), diffChunks);
|
view.show(username, {}, {}, m_settings.expiryDays.value(), diffChunks);
|
||||||
|
|
||||||
// Save new protocol in case user changed it.
|
// Save new protocol in case user changed it.
|
||||||
if (dialogResult == QDialog::Accepted && m_settings.protocols.value() != view.protocol()) {
|
if (dialogResult == QDialog::Accepted && m_settings.protocols.value() != view.protocol()) {
|
||||||
|
@@ -105,13 +105,11 @@ void DPasteDotComProtocol::paste(
|
|||||||
const QString &text,
|
const QString &text,
|
||||||
ContentType ct,
|
ContentType ct,
|
||||||
int expiryDays,
|
int expiryDays,
|
||||||
bool publicPaste,
|
|
||||||
const QString &username,
|
const QString &username,
|
||||||
const QString &comment,
|
const QString &comment,
|
||||||
const QString &description
|
const QString &description
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
Q_UNUSED(publicPaste)
|
|
||||||
Q_UNUSED(comment)
|
Q_UNUSED(comment)
|
||||||
|
|
||||||
// See http://dpaste.com/api/v2/
|
// See http://dpaste.com/api/v2/
|
||||||
|
@@ -44,7 +44,6 @@ private:
|
|||||||
void paste(const QString &text,
|
void paste(const QString &text,
|
||||||
ContentType ct = Text,
|
ContentType ct = Text,
|
||||||
int expiryDays = 1,
|
int expiryDays = 1,
|
||||||
bool publicPaste = false,
|
|
||||||
const QString &username = QString(),
|
const QString &username = QString(),
|
||||||
const QString &comment = QString(),
|
const QString &comment = QString(),
|
||||||
const QString &description = QString()) override;
|
const QString &description = QString()) override;
|
||||||
|
@@ -180,7 +180,6 @@ void FileShareProtocol::paste(
|
|||||||
const QString &text,
|
const QString &text,
|
||||||
ContentType /* ct */,
|
ContentType /* ct */,
|
||||||
int /* expiryDays */,
|
int /* expiryDays */,
|
||||||
bool /* publicPaste */,
|
|
||||||
const QString &username,
|
const QString &username,
|
||||||
const QString & /* comment */,
|
const QString & /* comment */,
|
||||||
const QString &description
|
const QString &description
|
||||||
|
@@ -52,7 +52,7 @@ public:
|
|||||||
void fetch(const QString &id) override;
|
void fetch(const QString &id) override;
|
||||||
void list() override;
|
void list() override;
|
||||||
void paste(const QString &text,
|
void paste(const QString &text,
|
||||||
ContentType ct = Text, int expiryDays = 1, bool publicPaste = false,
|
ContentType ct = Text, int expiryDays = 1,
|
||||||
const QString &username = QString(),
|
const QString &username = QString(),
|
||||||
const QString &comment = QString(),
|
const QString &comment = QString(),
|
||||||
const QString &description = QString()) override;
|
const QString &description = QString()) override;
|
||||||
|
@@ -103,7 +103,6 @@ void PasteBinDotComProtocol::paste(
|
|||||||
const QString &text,
|
const QString &text,
|
||||||
ContentType ct,
|
ContentType ct,
|
||||||
int expiryDays,
|
int expiryDays,
|
||||||
bool publicPaste,
|
|
||||||
const QString & /* username */, // Not used unless registered user
|
const QString & /* username */, // Not used unless registered user
|
||||||
const QString &comment,
|
const QString &comment,
|
||||||
const QString &description
|
const QString &description
|
||||||
@@ -122,7 +121,6 @@ void PasteBinDotComProtocol::paste(
|
|||||||
pasteData += format(ct);
|
pasteData += format(ct);
|
||||||
pasteData += "api_paste_name="; // Title or name.
|
pasteData += "api_paste_name="; // Title or name.
|
||||||
pasteData += QUrl::toPercentEncoding(description);
|
pasteData += QUrl::toPercentEncoding(description);
|
||||||
pasteData.append("&api_paste_private=").append(QByteArray(publicPaste ? "0" : "1"));
|
|
||||||
pasteData += "&api_paste_code=";
|
pasteData += "&api_paste_code=";
|
||||||
pasteData += QUrl::toPercentEncoding(fixNewLines(text));
|
pasteData += QUrl::toPercentEncoding(fixNewLines(text));
|
||||||
// fire request
|
// fire request
|
||||||
|
@@ -42,7 +42,6 @@ public:
|
|||||||
void paste(const QString &text,
|
void paste(const QString &text,
|
||||||
ContentType ct = Text,
|
ContentType ct = Text,
|
||||||
int expiryDays = 1,
|
int expiryDays = 1,
|
||||||
bool publicPaste = false,
|
|
||||||
const QString &username = QString(),
|
const QString &username = QString(),
|
||||||
const QString &comment = QString(),
|
const QString &comment = QString(),
|
||||||
const QString &description = QString()) override;
|
const QString &description = QString()) override;
|
||||||
|
@@ -144,7 +144,6 @@ int PasteView::show(
|
|||||||
const QString &description,
|
const QString &description,
|
||||||
const QString &comment,
|
const QString &comment,
|
||||||
int expiryDays,
|
int expiryDays,
|
||||||
bool makePublic,
|
|
||||||
const FileDataList &parts
|
const FileDataList &parts
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
@@ -162,20 +161,18 @@ int PasteView::show(
|
|||||||
m_ui.stackedWidget->setCurrentIndex(0);
|
m_ui.stackedWidget->setCurrentIndex(0);
|
||||||
m_ui.uiPatchView->setPlainText(content);
|
m_ui.uiPatchView->setPlainText(content);
|
||||||
setExpiryDays(expiryDays);
|
setExpiryDays(expiryDays);
|
||||||
setMakePublic(makePublic);
|
|
||||||
return showDialog();
|
return showDialog();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Show up with editable plain text.
|
// Show up with editable plain text.
|
||||||
int PasteView::show(const QString &user, const QString &description,
|
int PasteView::show(const QString &user, const QString &description,
|
||||||
const QString &comment, int expiryDays, bool makePublic, const QString &content)
|
const QString &comment, int expiryDays, const QString &content)
|
||||||
{
|
{
|
||||||
setupDialog(user, description, comment);
|
setupDialog(user, description, comment);
|
||||||
m_mode = PlainTextMode;
|
m_mode = PlainTextMode;
|
||||||
m_ui.stackedWidget->setCurrentIndex(1);
|
m_ui.stackedWidget->setCurrentIndex(1);
|
||||||
m_ui.plainTextEdit->setPlainText(content);
|
m_ui.plainTextEdit->setPlainText(content);
|
||||||
setExpiryDays(expiryDays);
|
setExpiryDays(expiryDays);
|
||||||
setMakePublic(makePublic);
|
|
||||||
return showDialog();
|
return showDialog();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -184,21 +181,11 @@ void PasteView::setExpiryDays(int d)
|
|||||||
m_ui.expirySpinBox->setValue(d);
|
m_ui.expirySpinBox->setValue(d);
|
||||||
}
|
}
|
||||||
|
|
||||||
void PasteView::setMakePublic(bool p)
|
|
||||||
{
|
|
||||||
m_ui.makePublicCheckBox->setChecked(p);
|
|
||||||
}
|
|
||||||
|
|
||||||
int PasteView::expiryDays() const
|
int PasteView::expiryDays() const
|
||||||
{
|
{
|
||||||
return m_ui.expirySpinBox->value();
|
return m_ui.expirySpinBox->value();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool PasteView::makePublic() const
|
|
||||||
{
|
|
||||||
return m_ui.makePublicCheckBox->isChecked();
|
|
||||||
}
|
|
||||||
|
|
||||||
void PasteView::accept()
|
void PasteView::accept()
|
||||||
{
|
{
|
||||||
const int index = m_ui.protocolBox->currentIndex();
|
const int index = m_ui.protocolBox->currentIndex();
|
||||||
@@ -215,7 +202,7 @@ void PasteView::accept()
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
const Protocol::ContentType ct = Protocol::contentType(m_mimeType);
|
const Protocol::ContentType ct = Protocol::contentType(m_mimeType);
|
||||||
protocol->paste(data, ct, expiryDays(), makePublic(), user(), comment(), description());
|
protocol->paste(data, ct, expiryDays(), user(), comment(), description());
|
||||||
// Store settings and close
|
// Store settings and close
|
||||||
QSettings *settings = Core::ICore::settings();
|
QSettings *settings = Core::ICore::settings();
|
||||||
settings->beginGroup(QLatin1String(groupC));
|
settings->beginGroup(QLatin1String(groupC));
|
||||||
|
@@ -52,10 +52,10 @@ public:
|
|||||||
|
|
||||||
// Show up with checkable list of diff chunks.
|
// Show up with checkable list of diff chunks.
|
||||||
int show(const QString &user, const QString &description, const QString &comment,
|
int show(const QString &user, const QString &description, const QString &comment,
|
||||||
int expiryDays, bool makePublic, const FileDataList &parts);
|
int expiryDays, const FileDataList &parts);
|
||||||
// Show up with editable plain text.
|
// Show up with editable plain text.
|
||||||
int show(const QString &user, const QString &description, const QString &comment,
|
int show(const QString &user, const QString &description, const QString &comment,
|
||||||
int expiryDays, bool makePublic, const QString &content);
|
int expiryDays, const QString &content);
|
||||||
|
|
||||||
void setProtocol(const QString &protocol);
|
void setProtocol(const QString &protocol);
|
||||||
|
|
||||||
@@ -65,9 +65,7 @@ public:
|
|||||||
QString content() const;
|
QString content() const;
|
||||||
int protocol() const;
|
int protocol() const;
|
||||||
void setExpiryDays(int d);
|
void setExpiryDays(int d);
|
||||||
void setMakePublic(bool p);
|
|
||||||
int expiryDays() const;
|
int expiryDays() const;
|
||||||
bool makePublic() const;
|
|
||||||
|
|
||||||
void accept() override;
|
void accept() override;
|
||||||
|
|
||||||
|
@@ -26,41 +26,17 @@
|
|||||||
<item row="0" column="1">
|
<item row="0" column="1">
|
||||||
<widget class="QComboBox" name="protocolBox"/>
|
<widget class="QComboBox" name="protocolBox"/>
|
||||||
</item>
|
</item>
|
||||||
<item row="3" column="0">
|
<item row="1" column="0">
|
||||||
<widget class="QLabel" name="userLabel">
|
<widget class="QLabel" name="expiryLabel">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>&Username:</string>
|
<string>&Expires after:</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="buddy">
|
<property name="buddy">
|
||||||
<cstring>uiUsername</cstring>
|
<cstring>expirySpinBox</cstring>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="3" column="1">
|
<item row="1" column="1">
|
||||||
<widget class="QLineEdit" name="uiUsername">
|
|
||||||
<property name="placeholderText">
|
|
||||||
<string><Username></string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="4" column="0">
|
|
||||||
<widget class="QLabel" name="descriptionLabel">
|
|
||||||
<property name="text">
|
|
||||||
<string>&Description:</string>
|
|
||||||
</property>
|
|
||||||
<property name="buddy">
|
|
||||||
<cstring>uiDescription</cstring>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="4" column="1">
|
|
||||||
<widget class="QLineEdit" name="uiDescription">
|
|
||||||
<property name="placeholderText">
|
|
||||||
<string><Description></string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="2" column="1">
|
|
||||||
<widget class="QSpinBox" name="expirySpinBox">
|
<widget class="QSpinBox" name="expirySpinBox">
|
||||||
<property name="suffix">
|
<property name="suffix">
|
||||||
<string> Days</string>
|
<string> Days</string>
|
||||||
@@ -74,24 +50,38 @@
|
|||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="2" column="0">
|
<item row="2" column="0">
|
||||||
<widget class="QLabel" name="expiryLabel">
|
<widget class="QLabel" name="userLabel">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>&Expires after:</string>
|
<string>&Username:</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="buddy">
|
<property name="buddy">
|
||||||
<cstring>expirySpinBox</cstring>
|
<cstring>uiUsername</cstring>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="0">
|
<item row="2" column="1">
|
||||||
<widget class="QLabel" name="makePublicLabel">
|
<widget class="QLineEdit" name="uiUsername">
|
||||||
|
<property name="placeholderText">
|
||||||
|
<string><Username></string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="3" column="0">
|
||||||
|
<widget class="QLabel" name="descriptionLabel">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Make public:</string>
|
<string>&Description:</string>
|
||||||
|
</property>
|
||||||
|
<property name="buddy">
|
||||||
|
<cstring>uiDescription</cstring>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="1">
|
<item row="3" column="1">
|
||||||
<widget class="QCheckBox" name="makePublicCheckBox"/>
|
<widget class="QLineEdit" name="uiDescription">
|
||||||
|
<property name="placeholderText">
|
||||||
|
<string><Description></string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
@@ -128,7 +118,16 @@ p, li { white-space: pre-wrap; }
|
|||||||
</property>
|
</property>
|
||||||
<widget class="QWidget" name="diffChunkPage">
|
<widget class="QWidget" name="diffChunkPage">
|
||||||
<layout class="QVBoxLayout" name="verticalLayout">
|
<layout class="QVBoxLayout" name="verticalLayout">
|
||||||
<property name="margin">
|
<property name="leftMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="topMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="rightMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="bottomMargin">
|
||||||
<number>0</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
<item>
|
<item>
|
||||||
@@ -149,7 +148,16 @@ p, li { white-space: pre-wrap; }
|
|||||||
<property name="spacing">
|
<property name="spacing">
|
||||||
<number>2</number>
|
<number>2</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="margin">
|
<property name="leftMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="topMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="rightMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="bottomMargin">
|
||||||
<number>0</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
<item>
|
<item>
|
||||||
@@ -200,7 +208,16 @@ p, li { white-space: pre-wrap; }
|
|||||||
</widget>
|
</widget>
|
||||||
<widget class="QWidget" name="plainTextPage">
|
<widget class="QWidget" name="plainTextPage">
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||||
<property name="margin">
|
<property name="leftMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="topMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="rightMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="bottomMargin">
|
||||||
<number>0</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
<item>
|
<item>
|
||||||
|
@@ -68,7 +68,6 @@ public:
|
|||||||
virtual void paste(const QString &text,
|
virtual void paste(const QString &text,
|
||||||
ContentType ct = Text,
|
ContentType ct = Text,
|
||||||
int expiryDays = 1,
|
int expiryDays = 1,
|
||||||
bool publicPaste = false,
|
|
||||||
const QString &username = QString(),
|
const QString &username = QString(),
|
||||||
const QString &comment = QString(),
|
const QString &comment = QString(),
|
||||||
const QString &description = QString()) = 0;
|
const QString &description = QString()) = 0;
|
||||||
|
@@ -69,10 +69,6 @@ Settings::Settings()
|
|||||||
displayOutput.setSettingsKey("DisplayOutput");
|
displayOutput.setSettingsKey("DisplayOutput");
|
||||||
displayOutput.setDefaultValue(true);
|
displayOutput.setDefaultValue(true);
|
||||||
displayOutput.setLabelText(tr("Display Output pane after sending a post"));
|
displayOutput.setLabelText(tr("Display Output pane after sending a post"));
|
||||||
|
|
||||||
registerAspect(&publicPaste);
|
|
||||||
publicPaste.setSettingsKey("DisplayOutput");
|
|
||||||
publicPaste.setLabelText(tr("Make pasted content public by default"));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// SettingsPage
|
// SettingsPage
|
||||||
@@ -98,7 +94,6 @@ SettingsPage::SettingsPage(Settings *settings)
|
|||||||
},
|
},
|
||||||
s.copyToClipboard,
|
s.copyToClipboard,
|
||||||
s.displayOutput,
|
s.displayOutput,
|
||||||
s.publicPaste,
|
|
||||||
Stretch()
|
Stretch()
|
||||||
}.attachTo(widget);
|
}.attachTo(widget);
|
||||||
});
|
});
|
||||||
|
@@ -43,7 +43,6 @@ public:
|
|||||||
Utils::IntegerAspect expiryDays;
|
Utils::IntegerAspect expiryDays;
|
||||||
Utils::BoolAspect copyToClipboard;
|
Utils::BoolAspect copyToClipboard;
|
||||||
Utils::BoolAspect displayOutput;
|
Utils::BoolAspect displayOutput;
|
||||||
Utils::BoolAspect publicPaste;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class SettingsPage final : public Core::IOptionsPage
|
class SettingsPage final : public Core::IOptionsPage
|
||||||
|
@@ -101,7 +101,6 @@ void StickyNotesPasteProtocol::paste(
|
|||||||
const QString &text,
|
const QString &text,
|
||||||
ContentType ct,
|
ContentType ct,
|
||||||
int expiryDays,
|
int expiryDays,
|
||||||
bool publicPaste,
|
|
||||||
const QString &username,
|
const QString &username,
|
||||||
const QString &comment,
|
const QString &comment,
|
||||||
const QString &description
|
const QString &description
|
||||||
@@ -111,7 +110,6 @@ void StickyNotesPasteProtocol::paste(
|
|||||||
|
|
||||||
Q_UNUSED(username)
|
Q_UNUSED(username)
|
||||||
Q_UNUSED(comment)
|
Q_UNUSED(comment)
|
||||||
Q_UNUSED(publicPaste)
|
|
||||||
QTC_ASSERT(!m_pasteReply, return);
|
QTC_ASSERT(!m_pasteReply, return);
|
||||||
|
|
||||||
// Format body
|
// Format body
|
||||||
|
@@ -39,7 +39,6 @@ public:
|
|||||||
void paste(const QString &text,
|
void paste(const QString &text,
|
||||||
ContentType ct = Text,
|
ContentType ct = Text,
|
||||||
int expiryDays = 1,
|
int expiryDays = 1,
|
||||||
bool publicPaste = false,
|
|
||||||
const QString &username = QString(),
|
const QString &username = QString(),
|
||||||
const QString &comment = QString(),
|
const QString &comment = QString(),
|
||||||
const QString &description = QString()) override;
|
const QString &description = QString()) override;
|
||||||
|
@@ -63,7 +63,7 @@ void UrlOpenProtocol::fetchFinished()
|
|||||||
emit fetchDone(title, content, error);
|
emit fetchDone(title, content, error);
|
||||||
}
|
}
|
||||||
|
|
||||||
void UrlOpenProtocol::paste(const QString &, ContentType, int, bool,
|
void UrlOpenProtocol::paste(const QString &, ContentType, int, const QString &,
|
||||||
const QString &, const QString &, const QString &)
|
const QString &, const QString &)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
@@ -36,7 +36,7 @@ public:
|
|||||||
QString name() const override;
|
QString name() const override;
|
||||||
unsigned capabilities() const override;
|
unsigned capabilities() const override;
|
||||||
void fetch(const QString &url) override;
|
void fetch(const QString &url) override;
|
||||||
void paste(const QString &, ContentType, int, bool, const QString &, const QString &, const QString &) override;
|
void paste(const QString &, ContentType, int, const QString &, const QString &, const QString &) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void fetchFinished();
|
void fetchFinished();
|
||||||
|
Reference in New Issue
Block a user