Skip to content

Commit 0665474

Browse files
committed
Merge branch 'hotfix/v0.11.3'
2 parents 74ae0e4 + a6fa7b0 commit 0665474

File tree

11 files changed

+624
-296
lines changed

11 files changed

+624
-296
lines changed

CuteMarkEd.wxs

Lines changed: 27 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -2,35 +2,34 @@
22
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
33
<?define ManufacturerName="CuteMarkEd Project"?>
44
<?define ProductName="CuteMarkEd"?>
5-
<?define ProductVersion="0.11.2"?>
6-
<Product Name="$(var.ProductName)"
7-
Id="*"
5+
<?define ProductVersion="0.11.3"?>
6+
<Product Name="$(var.ProductName)"
7+
Id="*"
88
UpgradeCode="335156FC-CB7F-4357-98D4-B5519E66402B"
9-
Language="1033"
10-
Version="$(var.ProductVersion)"
9+
Language="1033"
10+
Version="$(var.ProductVersion)"
1111
Manufacturer="$(var.ManufacturerName)">
1212

1313
<Package Id="*"
14-
InstallerVersion="200"
14+
InstallerVersion="200"
1515
Compressed="yes"
1616
Description="CuteMarkEd Installer"
1717
Manufacturer="$(var.ManufacturerName)"
1818
/>
1919

20-
<Media Id="1"
21-
Cabinet="cutemarked.cab"
20+
<Media Id="1"
21+
Cabinet="cutemarked.cab"
2222
EmbedCab="yes"
2323
/>
2424

2525
<MajorUpgrade
2626
DowngradeErrorMessage="CuteMarkEd is already installed with a higher version."
2727
AllowSameVersionUpgrades="yes" />
2828

29-
<!-- Directory tree -->
30-
<Directory Id="TARGETDIR" Name="SourceDir">
29+
<!-- Directory tree -->
30+
<Directory Id="TARGETDIR" Name="SourceDir">
3131
<Directory Id="ProgramFilesFolder">
3232
<Directory Id="INSTALLDIR" Name="$(var.ProductName)">
33-
<Directory Id="accessible" Name="accessible"/>
3433
<Directory Id="dictionaries" Name="dictionaries"/>
3534
<Directory Id="iconengines" Name="iconengines"/>
3635
<Directory Id="imageformats" Name="imageformats"/>
@@ -39,7 +38,7 @@
3938
<Directory Id="translations" Name="translations"/>
4039
</Directory>
4140
</Directory>
42-
41+
4342
<Directory Id="ProgramMenuFolder">
4443
<Directory Id="ProgramMenuDir" Name="$(var.ProductName) $(var.ProductVersion)">
4544
<Component Id="ApplicationShortcuts" Guid="EDF171FF-255B-4036-A363-C81D6E0F4F21">
@@ -80,13 +79,14 @@
8079
<File Id="Qt5QuickLibrary" Source="Qt5Quick.dll"/>
8180
<File Id="Qt5SensorsLibrary" Source="Qt5Sensors.dll"/>
8281
<File Id="Qt5SqlLibrary" Source="Qt5Sql.dll"/>
82+
<File Id="Qt5WebChannelLibrary" Source="Qt5WebChannel.dll"/>
8383
<File Id="Qt5WebKitLibrary" Source="Qt5WebKit.dll"/>
8484
<File Id="Qt5WebKitWidgetsLibrary" Source="Qt5WebKitWidgets.dll"/>
8585
<File Id="Qt5WidgetsLibrary" Source="Qt5Widgets.dll"/>
8686
<File Id="Qt5WinExtras" Source="Qt5WinExtras.dll"/>
87-
<File Id="icudt51Library" Source="icudt51.dll"/>
88-
<File Id="icuin51Library" Source="icuin51.dll"/>
89-
<File Id="icuuc51Library" Source="icuuc51.dll"/>
87+
<File Id="icudt53Library" Source="icudt53.dll"/>
88+
<File Id="icuin53Library" Source="icuin53.dll"/>
89+
<File Id="icuuc53Library" Source="icuuc53.dll"/>
9090
<File Id="libgcc_s_dw2Library" Source="libgcc_s_dw2-1.dll"/>
9191
<File Id="libstdcppLibrary" Source="libstdc++-6.dll"/>
9292
<File Id="libwinpthreadLibrary" Source="libwinpthread-1.dll"/>
@@ -110,12 +110,6 @@
110110
</Component>
111111
</DirectoryRef>
112112

113-
<DirectoryRef Id="accessible">
114-
<Component Id="QtAccessiblityComponent" Guid="A4B2D7FA-3B7F-4F03-B3B1-AF5C212F4B44" DiskId="1">
115-
<File Id="QtAccessibleWidgetsPlugin" Source="accessible/qtaccessiblewidgets.dll"/>
116-
</Component>
117-
</DirectoryRef>
118-
119113
<DirectoryRef Id="dictionaries">
120114
<Component Id="DictionariesComponent" Guid="AAC09D8C-FFD2-46DF-BDA2-081D26AFF431" DiskId="1">
121115
<File Id="cs_CZ.aff" Source="dictionaries/cs_CZ.aff"/>
@@ -132,7 +126,7 @@
132126
<File Id="README_en_US.txt" Source="dictionaries/README_en_US.txt"/>
133127
</Component>
134128
</DirectoryRef>
135-
129+
136130
<!-- Fontawesome Icon Engine -->
137131
<DirectoryRef Id="iconengines">
138132
<Component Id="IconEngineComponent" Guid="E7E34602-4099-4A73-8533-7631EF7D598A" DiskId="1">
@@ -142,14 +136,17 @@
142136

143137
<DirectoryRef Id="imageformats">
144138
<Component Id="QtImageFormatsComponent" Guid="B688FB5F-318F-494D-BF56-C83F3BB3F946" DiskId="1">
139+
<File Id="QtDdsPlugin" Source="imageformats/qdds.dll"/>
145140
<File Id="QtGifPlugin" Source="imageformats/qgif.dll"/>
146141
<File Id="QtIcoPlugin" Source="imageformats/qico.dll"/>
142+
<File Id="QtJp2Plugin" Source="imageformats/qjp2.dll"/>
147143
<File Id="QtJpegPlugin" Source="imageformats/qjpeg.dll"/>
148144
<File Id="QtMngPlugin" Source="imageformats/qmng.dll"/>
149145
<File Id="QtSvgPlugin" Source="imageformats/qsvg.dll"/>
150146
<File Id="QtTgaPlugin" Source="imageformats/qtga.dll"/>
151147
<File Id="QtTiffPlugin" Source="imageformats/qtiff.dll"/>
152148
<File Id="QtWbmpPlugin" Source="imageformats/qwbmp.dll"/>
149+
<File Id="QtWebpPlugin" Source="imageformats/qwebp.dll"/>
153150
</Component>
154151
</DirectoryRef>
155152

@@ -168,22 +165,26 @@
168165
<DirectoryRef Id="translations">
169166
<Component Id="QtTranslationsComponent" Guid="245EDE4C-00C9-4FA9-9E78-D4B1C526AAF0" DiskId="1">
170167
<File Id="QtCSTranslation" Source="translations/qt_cs.qm"/>
168+
<File Id="QtDATranslation" Source="translations/qt_da.qm"/>
171169
<File Id="QtDETranslation" Source="translations/qt_de.qm"/>
170+
<File Id="QtESTranslation" Source="translations/qt_es.qm"/>
171+
<File Id="QtFRTranslation" Source="translations/qt_fr.qm"/>
172172
<File Id="QtHUTranslation" Source="translations/qt_hu.qm"/>
173173
<File Id="QtITTranslation" Source="translations/qt_it.qm"/>
174174
<File Id="QtJATranslation" Source="translations/qt_ja.qm"/>
175+
<File Id="QtPLTranslation" Source="translations/qt_pl.qm"/>
176+
<File Id="QtPTTranslation" Source="translations/qt_pt.qm"/>
175177
<File Id="QtRUTranslation" Source="translations/qt_ru.qm"/>
176178
<File Id="QtSKTranslation" Source="translations/qt_sk.qm"/>
177179
<File Id="QtUKTranslation" Source="translations/qt_uk.qm"/>
178180
<File Id="QtZHCNTranslation" Source="translations/qt_zh_CN.qm"/>
179181
<File Id="QtZHTWTranslation" Source="translations/qt_zh_TW.qm"/>
180182
</Component>
181183
</DirectoryRef>
182-
184+
183185
<Feature Id="Complete" Title="CuteMarkEd" Level="1">
184186
<ComponentRef Id="ProductComponent"/>
185187
<ComponentRef Id="Qt5Component"/>
186-
<ComponentRef Id="QtAccessiblityComponent"/>
187188
<ComponentRef Id="QtImageFormatsComponent"/>
188189
<ComponentRef Id="QtPlatformsComponent"/>
189190
<ComponentRef Id="QtPrintSupportComponent"/>
@@ -201,7 +202,7 @@
201202
<!-- Allow user to change the installation directory -->
202203
<Property Id="WIXUI_INSTALLDIR" Value="INSTALLDIR" />
203204
<UIRef Id="WixUI_InstallDir" />
204-
205+
205206
<!-- Skip license dialog -->
206207
<UI>
207208
<Publish Dialog="WelcomeDlg"
@@ -215,7 +216,7 @@
215216
Value="WelcomeDlg"
216217
Order="2">1</Publish>
217218
</UI>
218-
219+
219220
<Icon Id="CuteMarkEd.exe" SourceFile="cutemarked.exe"/>
220221
</Product>
221222
</Wix>

README.md

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ A Qt-based, free and open source markdown editor with live HTML preview, math ex
88

99
### DOWNLOAD
1010

11-
[Sources](https://github.com/cloose/CuteMarkEd/archive/v0.11.2.tar.gz)
12-
[MS Windows (Installer)](http://dl.bintray.com/cloose/CuteMarkEd/cutemarked-0.11.2.msi)
13-
[MS Windows (ZIP file)](http://dl.bintray.com/cloose/CuteMarkEd/cutemarked-0.11.2.zip)
11+
[Sources](https://github.com/cloose/CuteMarkEd/archive/v0.11.3.tar.gz)
12+
[MS Windows (Installer)](http://dl.bintray.com/cloose/CuteMarkEd/cutemarked-0.11.3.msi)
13+
[MS Windows (ZIP file)](http://dl.bintray.com/cloose/CuteMarkEd/cutemarked-0.11.3.zip)
1414
[OpenSUSE 13.2 (RPM)](https://build.opensuse.org/project/show?project=home%3Acloose1974)
1515
[Fedora 20 (RPM)](https://build.opensuse.org/project/show?project=home%3Acloose1974)
1616
[Fedora 21 (RPM)](https://build.opensuse.org/project/show?project=home%3Acloose1974)
@@ -19,6 +19,20 @@ A Qt-based, free and open source markdown editor with live HTML preview, math ex
1919

2020
### NEWS
2121

22+
#### Version 0.11.3
23+
24+
Improvements:
25+
26+
* `IMPROVED` Update Russian translation
27+
28+
Fixes:
29+
30+
* `FIXED` Missing links in exported PDF file (#275)
31+
* `FIXED` Use of non-native line endings when a file is saved (#97)
32+
* `FIXED` Corrupt files on system crashes or running out of disk space (#285)
33+
* `FIXED` Accessing all drives although the file explorer is not visible (#273)
34+
* `FIXED` Relative paths in recently used files menu (#256)
35+
2236
#### Version 0.11.2
2337

2438
Improvements:
@@ -81,7 +95,7 @@ Fixes:
8195

8296
### DEPENDENCIES
8397

84-
* [Qt 5.2](http://qt-project.org) (LGPL v2.1)
98+
* [Qt 5.4](http://qt-project.org) (LGPL v2.1)
8599
* [Discount 2.1.7](http://www.pell.portland.or.us/~orc/Code/discount/) (3-clause BSD)
86100
* [PEG Markdown Highlight](http://hasseg.org/peg-markdown-highlight/) (MIT License)
87101
* [hunspell 1.3.2](http://hunspell.sourceforge.net/) (LGPL v2.1)

app/app.pro

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,8 @@ HEADERS += \
9696
imagetooldialog.h \
9797
snippetcompleter.h \
9898
snippetstablemodel.h \
99-
aboutdialog.h
99+
aboutdialog.h \
100+
savefileadapter.h
100101

101102
FORMS += \
102103
mainwindow.ui \

app/controls/fileexplorerwidget.cpp

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,13 @@ class FileSortFilterProxyModel : public QSortFilterProxyModel
2727

2828
FileExplorerWidget::FileExplorerWidget(QWidget *parent) :
2929
QWidget(parent),
30+
initialized(false),
3031
ui(new Ui::FileExplorerWidget),
3132
model(new QFileSystemModel(this)),
3233
sortModel(new FileSortFilterProxyModel(this))
3334
{
3435
ui->setupUi(this);
3536

36-
model->setRootPath("");
37-
3837
sortModel->setDynamicSortFilter(true);
3938
sortModel->setSourceModel(model);
4039

@@ -51,6 +50,14 @@ FileExplorerWidget::~FileExplorerWidget()
5150
delete ui;
5251
}
5352

53+
void FileExplorerWidget::showEvent(QShowEvent *event)
54+
{
55+
if (!initialized) {
56+
model->setRootPath("");
57+
initialized = true;
58+
}
59+
}
60+
5461
void FileExplorerWidget::fileOpen(const QModelIndex &index)
5562
{
5663
QFileInfo info = model->fileInfo(sortModel->mapToSource(index));

app/controls/fileexplorerwidget.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,14 @@ class FileExplorerWidget : public QWidget
2121
signals:
2222
void fileSelected(const QString &filePath);
2323

24+
protected:
25+
void showEvent(QShowEvent *event);
26+
2427
private slots:
2528
void fileOpen(const QModelIndex &index);
2629

2730
private:
31+
bool initialized;
2832
Ui::FileExplorerWidget *ui;
2933
QFileSystemModel *model;
3034
QSortFilterProxyModel *sortModel;

app/controls/recentfilesmenu.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
#include "recentfilesmenu.h"
1818

1919
#include <QFileInfo>
20+
#include <QDir>
2021
#include <QSettings>
2122

2223
RecentFilesMenu::RecentFilesMenu(QWidget *parent) :
@@ -52,9 +53,12 @@ void RecentFilesMenu::saveState() const
5253

5354
void RecentFilesMenu::addFile(const QString &fileName)
5455
{
56+
QFileInfo fileInfo(fileName);
57+
QString absoluteNativeFileName(QDir::toNativeSeparators(fileInfo.absoluteFilePath()));
58+
5559
// add file to top of list
56-
recentFiles.removeAll(fileName);
57-
recentFiles.prepend(fileName);
60+
recentFiles.removeAll(absoluteNativeFileName);
61+
recentFiles.prepend(absoluteNativeFileName);
5862

5963
// remove last entry if list contains more than 10 entries
6064
if (recentFiles.size() > 10) {

app/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ int main(int argc, char *argv[])
5656
app.setOrganizationName("CuteMarkEd Project");
5757
app.setApplicationName("CuteMarkEd");
5858
app.setApplicationDisplayName("CuteMarkEd");
59-
app.setApplicationVersion("0.11.2");
59+
app.setApplicationVersion("0.11.3");
6060

6161
#ifdef Q_OS_WIN
6262
QStringList fileTypes;

app/mainwindow.cpp

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@
6464
#include "options.h"
6565
#include "optionsdialog.h"
6666
#include "revealviewsynchronizer.h"
67+
#include "savefileadapter.h"
6768
#include "snippetcompleter.h"
6869
#include "tabletooldialog.h"
6970

@@ -226,15 +227,22 @@ bool MainWindow::fileSave()
226227
return fileSaveAs();
227228
}
228229

229-
QTextDocumentWriter writer(fileName, "plaintext");
230+
SaveFileAdapter file(fileName);
231+
if (!file.open(QIODevice::WriteOnly | QIODevice::Text)) {
232+
return false;
233+
}
234+
235+
QTextDocumentWriter writer(&file, "plaintext");
230236
bool success = writer.write(ui->plainTextEdit->document());
231237
if (success) {
238+
file.commit();
239+
232240
// set status to unmodified
233241
ui->plainTextEdit->document()->setModified(false);
234242
setWindowModified(false);
235243

236244
// add to recent file list
237-
recentFilesMenu->addFile(QDir::toNativeSeparators(fileName));
245+
recentFilesMenu->addFile(fileName);
238246
}
239247

240248
return success;
@@ -304,10 +312,17 @@ void MainWindow::fileExportToHtml()
304312

305313
void MainWindow::fileExportToPdf()
306314
{
307-
ExportPdfDialog dialog(fileName);
308-
if (dialog.exec() == QDialog::Accepted) {
309-
ui->webView->print(dialog.printer());
310-
}
315+
// using temporary QTextDocument instance to get links exported\printed correctly,
316+
// as links will dissappear when printing directly from QWebView in current Qt implementation
317+
// of QWebView::print() method (possible bug in Qt?)
318+
// more info here: http://stackoverflow.com/questions/11629093/add-working-url-into-pdf-using-qt-qprinter
319+
320+
ExportPdfDialog dialog(fileName);
321+
if (dialog.exec() == QDialog::Accepted) {
322+
QTextDocument doc;
323+
doc.setHtml(ui->webView->page()->currentFrame()->toHtml());
324+
doc.print(dialog.printer());
325+
}
311326
}
312327

313328
void MainWindow::filePrint()
@@ -854,7 +869,7 @@ bool MainWindow::load(const QString &fileName)
854869

855870
// open file
856871
QFile file(fileName);
857-
if (!file.open(QFile::ReadOnly)) {
872+
if (!file.open(QFile::ReadOnly | QIODevice::Text)) {
858873
return false;
859874
}
860875

@@ -869,7 +884,7 @@ bool MainWindow::load(const QString &fileName)
869884
setFileName(fileName);
870885

871886
// add to recent files
872-
recentFilesMenu->addFile(QDir::toNativeSeparators(fileName));
887+
recentFilesMenu->addFile(fileName);
873888

874889
return true;
875890
}

0 commit comments

Comments
 (0)