mirror of
https://github.com/kotatogram/kotatogram-desktop
synced 2025-09-05 00:55:12 +00:00
folders not allowed to be dropped / pasted
This commit is contained in:
@@ -216,6 +216,10 @@ void FileLoadTask::process() {
|
||||
|
||||
if (!_filepath.isEmpty()) {
|
||||
QFileInfo info(_filepath);
|
||||
if (info.isDir()) {
|
||||
_result->filesize = -1;
|
||||
return;
|
||||
}
|
||||
filesize = info.size();
|
||||
filemime = mimeTypeForFile(info).name();
|
||||
filename = info.fileName();
|
||||
@@ -399,6 +403,11 @@ void FileLoadTask::finish() {
|
||||
App::wnd()->replaceLayer(new InformBox(lang(lng_send_image_empty)));
|
||||
return;
|
||||
}
|
||||
if (_result->filesize == -1) { // dir
|
||||
App::main()->onSendFileCancel(_result);
|
||||
App::wnd()->replaceLayer(new InformBox(lng_send_folder(lt_name, QFileInfo(_filepath).fileName())));
|
||||
return;
|
||||
}
|
||||
if (_result->filesize > MaxUploadDocumentSize) {
|
||||
App::main()->onSendFileCancel(_result);
|
||||
App::wnd()->replaceLayer(new InformBox(lang(lng_send_image_too_large)));
|
||||
|
Reference in New Issue
Block a user