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