mirror of
https://gitee.com/vnotex/vnote.git
synced 2025-07-05 13:59:52 +08:00
small fix
This commit is contained in:
parent
9d76d1f06b
commit
508610d304
@ -81,6 +81,11 @@ QStringList FileNode::addAttachment(const QString &p_destFolderPath, const QStri
|
||||
{
|
||||
QStringList addedFiles;
|
||||
for (const auto &file : p_files) {
|
||||
if (PathUtils::isDir(file)) {
|
||||
qWarning() << "skip adding folder as attachment" << file;
|
||||
continue;
|
||||
}
|
||||
|
||||
auto destFilePath = m_backend->renameIfExistsCaseInsensitive(
|
||||
PathUtils::concatenateFilePath(p_destFolderPath, PathUtils::fileName(file)));
|
||||
m_backend->copyFile(file, destFilePath);
|
||||
|
@ -252,10 +252,10 @@
|
||||
"linkify" : true,
|
||||
"//comment" : "Whether add indentation to the first line of paragraph",
|
||||
"indent_first_line" : false,
|
||||
"//comment" : "Whether enable smart table (formation)",
|
||||
"//comment" : "Whether enable smart table (formatting)",
|
||||
"smart_table" : true,
|
||||
"//comment" : "Time interval (milliseconds) to do smart table formation",
|
||||
"smart_table_interval" : 2000
|
||||
"//comment" : "Time interval (milliseconds) to do smart table formatting",
|
||||
"smart_table_interval" : 1000
|
||||
}
|
||||
},
|
||||
"widget" : {
|
||||
|
@ -591,7 +591,7 @@ bool MarkdownEditor::processUrlFromMimeData(const QMimeData *p_source)
|
||||
if (!localFile.isEmpty()) {
|
||||
dialog.addSelection(tr("Insert As Relative Link"), 3);
|
||||
|
||||
if (m_buffer->isAttachmentSupported() && !m_buffer->isAttachment(localFile)) {
|
||||
if (m_buffer->isAttachmentSupported() && !m_buffer->isAttachment(localFile) && !PathUtils::isDir(localFile)) {
|
||||
dialog.addSelection(tr("Attach And Insert Link"), 6);
|
||||
}
|
||||
}
|
||||
|
@ -32,6 +32,14 @@ QTimer *MarkdownTableHelper::getTimer()
|
||||
m_timer->setInterval(ConfigMgr::getInst().getEditorConfig().getMarkdownEditorConfig().getSmartTableInterval());
|
||||
connect(m_timer, &QTimer::timeout,
|
||||
this, &MarkdownTableHelper::formatTable);
|
||||
|
||||
connect(m_editor->getTextEdit(), &QTextEdit::cursorPositionChanged,
|
||||
this, [this]() {
|
||||
if (m_timer->isActive()) {
|
||||
// Defer the formatting.
|
||||
m_timer->start();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
return m_timer;
|
||||
|
Loading…
x
Reference in New Issue
Block a user