aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Kandeler <christian.kandeler@qt.io>2021-11-22 15:35:07 +0100
committerChristian Kandeler <christian.kandeler@qt.io>2021-11-24 11:54:49 +0000
commit85b5a887e89ca5b7a36faaa0d30ca33bced9dcce (patch)
tree469b6ce5e778c13cb4bcc4e35d51528d2ece6c0b
parent04b1c92767a2c807334c0420801a457511fe6a46 (diff)
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>
-rw-r--r--doc/qtcreator/src/editors/creator-only/creator-code-pasting.qdoc3
-rw-r--r--src/plugins/cpaster/cpasterplugin.cpp4
-rw-r--r--src/plugins/cpaster/dpastedotcomprotocol.cpp2
-rw-r--r--src/plugins/cpaster/dpastedotcomprotocol.h1
-rw-r--r--src/plugins/cpaster/fileshareprotocol.cpp1
-rw-r--r--src/plugins/cpaster/fileshareprotocol.h2
-rw-r--r--src/plugins/cpaster/pastebindotcomprotocol.cpp2
-rw-r--r--src/plugins/cpaster/pastebindotcomprotocol.h1
-rw-r--r--src/plugins/cpaster/pasteview.cpp17
-rw-r--r--src/plugins/cpaster/pasteview.h6
-rw-r--r--src/plugins/cpaster/pasteview.ui97
-rw-r--r--src/plugins/cpaster/protocol.h1
-rw-r--r--src/plugins/cpaster/settings.cpp5
-rw-r--r--src/plugins/cpaster/settings.h1
-rw-r--r--src/plugins/cpaster/stickynotespasteprotocol.cpp2
-rw-r--r--src/plugins/cpaster/stickynotespasteprotocol.h1
-rw-r--r--src/plugins/cpaster/urlopenprotocol.cpp4
-rw-r--r--src/plugins/cpaster/urlopenprotocol.h2
18 files changed, 67 insertions, 85 deletions
diff --git a/doc/qtcreator/src/editors/creator-only/creator-code-pasting.qdoc b/doc/qtcreator/src/editors/creator-only/creator-code-pasting.qdoc
index 852500d1b0f..5fbc28c8323 100644
--- a/doc/qtcreator/src/editors/creator-only/creator-code-pasting.qdoc
+++ b/doc/qtcreator/src/editors/creator-only/creator-code-pasting.qdoc
@@ -59,9 +59,6 @@
\li Select the \uicontrol {Display Output pane after sending a post}
check box to display the URL in the \uicontrol {General Messages}
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
Select \uicontrol Fileshare to specify the path to a shared network drive.
diff --git a/src/plugins/cpaster/cpasterplugin.cpp b/src/plugins/cpaster/cpasterplugin.cpp
index beda75c4f6e..12fe84ad5a0 100644
--- a/src/plugins/cpaster/cpasterplugin.cpp
+++ b/src/plugins/cpaster/cpasterplugin.cpp
@@ -274,8 +274,8 @@ void CodePasterPluginPrivate::post(QString data, const QString &mimeType)
const FileDataList diffChunks = splitDiffToFiles(data);
const int dialogResult = diffChunks.isEmpty() ?
- view.show(username, {}, {}, m_settings.expiryDays.value(), m_settings.publicPaste.value(), data) :
- view.show(username, {}, {}, m_settings.expiryDays.value(), m_settings.publicPaste.value(), diffChunks);
+ view.show(username, {}, {}, m_settings.expiryDays.value(), data) :
+ view.show(username, {}, {}, m_settings.expiryDays.value(), diffChunks);
// Save new protocol in case user changed it.
if (dialogResult == QDialog::Accepted && m_settings.protocols.value() != view.protocol()) {
diff --git a/src/plugins/cpaster/dpastedotcomprotocol.cpp b/src/plugins/cpaster/dpastedotcomprotocol.cpp
index da9863bb4d6..fe333a5630b 100644
--- a/src/plugins/cpaster/dpastedotcomprotocol.cpp
+++ b/src/plugins/cpaster/dpastedotcomprotocol.cpp
@@ -105,13 +105,11 @@ void DPasteDotComProtocol::paste(
const QString &text,
ContentType ct,
int expiryDays,
- bool publicPaste,
const QString &username,
const QString &comment,
const QString &description
)
{
- Q_UNUSED(publicPaste)
Q_UNUSED(comment)
// See http://dpaste.com/api/v2/
diff --git a/src/plugins/cpaster/dpastedotcomprotocol.h b/src/plugins/cpaster/dpastedotcomprotocol.h
index 9b39052d8cb..b7c7452b445 100644
--- a/src/plugins/cpaster/dpastedotcomprotocol.h
+++ b/src/plugins/cpaster/dpastedotcomprotocol.h
@@ -44,7 +44,6 @@ private:
void paste(const QString &text,
ContentType ct = Text,
int expiryDays = 1,
- bool publicPaste = false,
const QString &username = QString(),
const QString &comment = QString(),
const QString &description = QString()) override;
diff --git a/src/plugins/cpaster/fileshareprotocol.cpp b/src/plugins/cpaster/fileshareprotocol.cpp
index b9e0dd9b22c..87e5e6f068e 100644
--- a/src/plugins/cpaster/fileshareprotocol.cpp
+++ b/src/plugins/cpaster/fileshareprotocol.cpp
@@ -180,7 +180,6 @@ void FileShareProtocol::paste(
const QString &text,
ContentType /* ct */,
int /* expiryDays */,
- bool /* publicPaste */,
const QString &username,
const QString & /* comment */,
const QString &description
diff --git a/src/plugins/cpaster/fileshareprotocol.h b/src/plugins/cpaster/fileshareprotocol.h
index 316cdf867a4..3bc0fa8e337 100644
--- a/src/plugins/cpaster/fileshareprotocol.h
+++ b/src/plugins/cpaster/fileshareprotocol.h
@@ -52,7 +52,7 @@ public:
void fetch(const QString &id) override;
void list() override;
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 &comment = QString(),
const QString &description = QString()) override;
diff --git a/src/plugins/cpaster/pastebindotcomprotocol.cpp b/src/plugins/cpaster/pastebindotcomprotocol.cpp
index 7ff8469ea2e..30490608e37 100644
--- a/src/plugins/cpaster/pastebindotcomprotocol.cpp
+++ b/src/plugins/cpaster/pastebindotcomprotocol.cpp
@@ -103,7 +103,6 @@ void PasteBinDotComProtocol::paste(
const QString &text,
ContentType ct,
int expiryDays,
- bool publicPaste,
const QString & /* username */, // Not used unless registered user
const QString &comment,
const QString &description
@@ -122,7 +121,6 @@ void PasteBinDotComProtocol::paste(
pasteData += format(ct);
pasteData += "api_paste_name="; // Title or name.
pasteData += QUrl::toPercentEncoding(description);
- pasteData.append("&api_paste_private=").append(QByteArray(publicPaste ? "0" : "1"));
pasteData += "&api_paste_code=";
pasteData += QUrl::toPercentEncoding(fixNewLines(text));
// fire request
diff --git a/src/plugins/cpaster/pastebindotcomprotocol.h b/src/plugins/cpaster/pastebindotcomprotocol.h
index 7e2d1f5cdf9..f5f308a77b9 100644
--- a/src/plugins/cpaster/pastebindotcomprotocol.h
+++ b/src/plugins/cpaster/pastebindotcomprotocol.h
@@ -42,7 +42,6 @@ public:
void paste(const QString &text,
ContentType ct = Text,
int expiryDays = 1,
- bool publicPaste = false,
const QString &username = QString(),
const QString &comment = QString(),
const QString &description = QString()) override;
diff --git a/src/plugins/cpaster/pasteview.cpp b/src/plugins/cpaster/pasteview.cpp
index adaf099200b..04c87cda631 100644
--- a/src/plugins/cpaster/pasteview.cpp
+++ b/src/plugins/cpaster/pasteview.cpp
@@ -144,7 +144,6 @@ int PasteView::show(
const QString &description,
const QString &comment,
int expiryDays,
- bool makePublic,
const FileDataList &parts
)
{
@@ -162,20 +161,18 @@ int PasteView::show(
m_ui.stackedWidget->setCurrentIndex(0);
m_ui.uiPatchView->setPlainText(content);
setExpiryDays(expiryDays);
- setMakePublic(makePublic);
return showDialog();
}
// Show up with editable plain text.
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);
m_mode = PlainTextMode;
m_ui.stackedWidget->setCurrentIndex(1);
m_ui.plainTextEdit->setPlainText(content);
setExpiryDays(expiryDays);
- setMakePublic(makePublic);
return showDialog();
}
@@ -184,21 +181,11 @@ void PasteView::setExpiryDays(int d)
m_ui.expirySpinBox->setValue(d);
}
-void PasteView::setMakePublic(bool p)
-{
- m_ui.makePublicCheckBox->setChecked(p);
-}
-
int PasteView::expiryDays() const
{
return m_ui.expirySpinBox->value();
}
-bool PasteView::makePublic() const
-{
- return m_ui.makePublicCheckBox->isChecked();
-}
-
void PasteView::accept()
{
const int index = m_ui.protocolBox->currentIndex();
@@ -215,7 +202,7 @@ void PasteView::accept()
return;
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
QSettings *settings = Core::ICore::settings();
settings->beginGroup(QLatin1String(groupC));
diff --git a/src/plugins/cpaster/pasteview.h b/src/plugins/cpaster/pasteview.h
index 73804b53b49..4a93a46c217 100644
--- a/src/plugins/cpaster/pasteview.h
+++ b/src/plugins/cpaster/pasteview.h
@@ -52,10 +52,10 @@ public:
// Show up with checkable list of diff chunks.
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.
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);
@@ -65,9 +65,7 @@ public:
QString content() const;
int protocol() const;
void setExpiryDays(int d);
- void setMakePublic(bool p);
int expiryDays() const;
- bool makePublic() const;
void accept() override;
diff --git a/src/plugins/cpaster/pasteview.ui b/src/plugins/cpaster/pasteview.ui
index c4719dded14..bafac83be4c 100644
--- a/src/plugins/cpaster/pasteview.ui
+++ b/src/plugins/cpaster/pasteview.ui
@@ -26,41 +26,17 @@
<item row="0" column="1">
<widget class="QComboBox" name="protocolBox"/>
</item>
- <item row="3" column="0">
- <widget class="QLabel" name="userLabel">
- <property name="text">
- <string>&amp;Username:</string>
- </property>
- <property name="buddy">
- <cstring>uiUsername</cstring>
- </property>
- </widget>
- </item>
- <item row="3" column="1">
- <widget class="QLineEdit" name="uiUsername">
- <property name="placeholderText">
- <string>&lt;Username&gt;</string>
- </property>
- </widget>
- </item>
- <item row="4" column="0">
- <widget class="QLabel" name="descriptionLabel">
+ <item row="1" column="0">
+ <widget class="QLabel" name="expiryLabel">
<property name="text">
- <string>&amp;Description:</string>
+ <string>&amp;Expires after:</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>&lt;Description&gt;</string>
+ <cstring>expirySpinBox</cstring>
</property>
</widget>
</item>
- <item row="2" column="1">
+ <item row="1" column="1">
<widget class="QSpinBox" name="expirySpinBox">
<property name="suffix">
<string> Days</string>
@@ -74,24 +50,38 @@
</widget>
</item>
<item row="2" column="0">
- <widget class="QLabel" name="expiryLabel">
+ <widget class="QLabel" name="userLabel">
<property name="text">
- <string>&amp;Expires after:</string>
+ <string>&amp;Username:</string>
</property>
<property name="buddy">
- <cstring>expirySpinBox</cstring>
+ <cstring>uiUsername</cstring>
</property>
</widget>
</item>
- <item row="1" column="0">
- <widget class="QLabel" name="makePublicLabel">
+ <item row="2" column="1">
+ <widget class="QLineEdit" name="uiUsername">
+ <property name="placeholderText">
+ <string>&lt;Username&gt;</string>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="0">
+ <widget class="QLabel" name="descriptionLabel">
<property name="text">
- <string>Make public:</string>
+ <string>&amp;Description:</string>
+ </property>
+ <property name="buddy">
+ <cstring>uiDescription</cstring>
</property>
</widget>
</item>
- <item row="1" column="1">
- <widget class="QCheckBox" name="makePublicCheckBox"/>
+ <item row="3" column="1">
+ <widget class="QLineEdit" name="uiDescription">
+ <property name="placeholderText">
+ <string>&lt;Description&gt;</string>
+ </property>
+ </widget>
</item>
</layout>
</item>
@@ -128,7 +118,16 @@ p, li { white-space: pre-wrap; }
</property>
<widget class="QWidget" name="diffChunkPage">
<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>
</property>
<item>
@@ -149,7 +148,16 @@ p, li { white-space: pre-wrap; }
<property name="spacing">
<number>2</number>
</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>
</property>
<item>
@@ -200,7 +208,16 @@ p, li { white-space: pre-wrap; }
</widget>
<widget class="QWidget" name="plainTextPage">
<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>
</property>
<item>
diff --git a/src/plugins/cpaster/protocol.h b/src/plugins/cpaster/protocol.h
index d9b66d7cc41..c315a673d1c 100644
--- a/src/plugins/cpaster/protocol.h
+++ b/src/plugins/cpaster/protocol.h
@@ -68,7 +68,6 @@ public:
virtual void paste(const QString &text,
ContentType ct = Text,
int expiryDays = 1,
- bool publicPaste = false,
const QString &username = QString(),
const QString &comment = QString(),
const QString &description = QString()) = 0;
diff --git a/src/plugins/cpaster/settings.cpp b/src/plugins/cpaster/settings.cpp
index bf6f9f6d47d..d10af8fb807 100644
--- a/src/plugins/cpaster/settings.cpp
+++ b/src/plugins/cpaster/settings.cpp
@@ -69,10 +69,6 @@ Settings::Settings()
displayOutput.setSettingsKey("DisplayOutput");
displayOutput.setDefaultValue(true);
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
@@ -98,7 +94,6 @@ SettingsPage::SettingsPage(Settings *settings)
},
s.copyToClipboard,
s.displayOutput,
- s.publicPaste,
Stretch()
}.attachTo(widget);
});
diff --git a/src/plugins/cpaster/settings.h b/src/plugins/cpaster/settings.h
index 26f1aaada1c..77cee9ca918 100644
--- a/src/plugins/cpaster/settings.h
+++ b/src/plugins/cpaster/settings.h
@@ -43,7 +43,6 @@ public:
Utils::IntegerAspect expiryDays;
Utils::BoolAspect copyToClipboard;
Utils::BoolAspect displayOutput;
- Utils::BoolAspect publicPaste;
};
class SettingsPage final : public Core::IOptionsPage
diff --git a/src/plugins/cpaster/stickynotespasteprotocol.cpp b/src/plugins/cpaster/stickynotespasteprotocol.cpp
index c4924a70c8f..a3b5a7473fb 100644
--- a/src/plugins/cpaster/stickynotespasteprotocol.cpp
+++ b/src/plugins/cpaster/stickynotespasteprotocol.cpp
@@ -101,7 +101,6 @@ void StickyNotesPasteProtocol::paste(
const QString &text,
ContentType ct,
int expiryDays,
- bool publicPaste,
const QString &username,
const QString &comment,
const QString &description
@@ -111,7 +110,6 @@ void StickyNotesPasteProtocol::paste(
Q_UNUSED(username)
Q_UNUSED(comment)
- Q_UNUSED(publicPaste)
QTC_ASSERT(!m_pasteReply, return);
// Format body
diff --git a/src/plugins/cpaster/stickynotespasteprotocol.h b/src/plugins/cpaster/stickynotespasteprotocol.h
index 8c0b35e08c0..584c90a921c 100644
--- a/src/plugins/cpaster/stickynotespasteprotocol.h
+++ b/src/plugins/cpaster/stickynotespasteprotocol.h
@@ -39,7 +39,6 @@ public:
void paste(const QString &text,
ContentType ct = Text,
int expiryDays = 1,
- bool publicPaste = false,
const QString &username = QString(),
const QString &comment = QString(),
const QString &description = QString()) override;
diff --git a/src/plugins/cpaster/urlopenprotocol.cpp b/src/plugins/cpaster/urlopenprotocol.cpp
index 01e1cd58d84..64f416b19eb 100644
--- a/src/plugins/cpaster/urlopenprotocol.cpp
+++ b/src/plugins/cpaster/urlopenprotocol.cpp
@@ -63,7 +63,7 @@ void UrlOpenProtocol::fetchFinished()
emit fetchDone(title, content, error);
}
-void UrlOpenProtocol::paste(const QString &, ContentType, int, bool,
- const QString &, const QString &, const QString &)
+void UrlOpenProtocol::paste(const QString &, ContentType, int, const QString &,
+ const QString &, const QString &)
{
}
diff --git a/src/plugins/cpaster/urlopenprotocol.h b/src/plugins/cpaster/urlopenprotocol.h
index 161d2a16b2c..65f1fcb504c 100644
--- a/src/plugins/cpaster/urlopenprotocol.h
+++ b/src/plugins/cpaster/urlopenprotocol.h
@@ -36,7 +36,7 @@ public:
QString name() const override;
unsigned capabilities() const 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:
void fetchFinished();