removed default image uploader
This commit is contained in:
@@ -209,6 +209,9 @@ Split::Split(QWidget *parent)
|
||||
[this] { this->focusLost.invoke(); });
|
||||
this->input_->ui_.textEdit->imagePasted.connect(
|
||||
[this](const QMimeData *source) {
|
||||
if (!getSettings()->imageUploaderEnabled)
|
||||
return;
|
||||
|
||||
if (getSettings()->askOnImageUpload.getValue())
|
||||
{
|
||||
QMessageBox msgBox;
|
||||
@@ -235,7 +238,10 @@ Split::Split(QWidget *parent)
|
||||
}
|
||||
upload(source, this->getChannel(), *this->input_->ui_.textEdit);
|
||||
});
|
||||
setAcceptDrops(true);
|
||||
|
||||
getSettings()->imageUploaderEnabled.connect(
|
||||
[this](const bool &val) { this->setAcceptDrops(val); },
|
||||
this->managedConnections_);
|
||||
}
|
||||
|
||||
Split::~Split()
|
||||
@@ -742,7 +748,8 @@ void Split::reloadChannelAndSubscriberEmotes()
|
||||
|
||||
void Split::dragEnterEvent(QDragEnterEvent *event)
|
||||
{
|
||||
if (event->mimeData()->hasImage() || event->mimeData()->hasUrls())
|
||||
if (getSettings()->imageUploaderEnabled &&
|
||||
(event->mimeData()->hasImage() || event->mimeData()->hasUrls()))
|
||||
{
|
||||
event->acceptProposedAction();
|
||||
}
|
||||
@@ -754,7 +761,8 @@ void Split::dragEnterEvent(QDragEnterEvent *event)
|
||||
|
||||
void Split::dropEvent(QDropEvent *event)
|
||||
{
|
||||
if (event->mimeData()->hasImage() || event->mimeData()->hasUrls())
|
||||
if (getSettings()->imageUploaderEnabled &&
|
||||
(event->mimeData()->hasImage() || event->mimeData()->hasUrls()))
|
||||
{
|
||||
this->input_->ui_.textEdit->imagePasted.invoke(event->mimeData());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user