File tree 3 files changed +33
-11
lines changed
3 files changed +33
-11
lines changed Original file line number Diff line number Diff line change @@ -89,17 +89,22 @@ Page {
89
89
enabled: idle
90
90
91
91
Image {
92
- anchors .fill : parent
92
+ anchors {
93
+ top: label1 .bottom
94
+ left: parent .left
95
+ right: parent .right
96
+ }
93
97
fillMode: Image .Pad
94
98
horizontalAlignment: Image .AlignHCenter
95
- verticalAlignment: Image .AlignVCenter
96
99
source: " image://theme/icon-m-camera"
97
100
scale: 1.5
98
101
z: 30
99
102
}
100
103
101
104
Label {
105
+ id: label1
102
106
anchors .topMargin : 10 ;
107
+ anchors .bottomMargin : 10 ;
103
108
anchors .top : parent .top
104
109
width: parent .width
105
110
horizontalAlignment: Text .AlignHCenter
@@ -123,16 +128,21 @@ Page {
123
128
enabled: idle
124
129
125
130
Image {
126
- anchors .fill : parent
131
+ anchors {
132
+ top: label2 .bottom
133
+ left: parent .left
134
+ right: parent .right
135
+ }
127
136
fillMode: Image .Pad
128
137
horizontalAlignment: Image .AlignHCenter
129
- verticalAlignment: Image .AlignVCenter
130
138
source: " image://theme/icon-l-image"
131
139
z: 30
132
140
}
133
141
134
142
Label {
143
+ id: label2
135
144
anchors .topMargin : 10 ;
145
+ anchors .bottomMargin : 10 ;
136
146
anchors .top : parent .top
137
147
width: parent .width
138
148
horizontalAlignment: Text .AlignHCenter
@@ -174,16 +184,21 @@ Page {
174
184
enabled: idle
175
185
176
186
Image {
177
- anchors .fill : parent
187
+ anchors {
188
+ top: label3 .bottom
189
+ left: parent .left
190
+ right: parent .right
191
+ }
178
192
fillMode: Image .Pad
179
193
horizontalAlignment: Image .AlignHCenter
180
- verticalAlignment: Image .AlignVCenter
181
194
source: " image://theme/icon-l-document"
182
195
z: 30
183
196
}
184
197
185
198
Label {
199
+ id: label3
186
200
anchors .topMargin : 10 ;
201
+ anchors .bottomMargin : 10 ;
187
202
anchors .top : parent .top
188
203
width: parent .width
189
204
horizontalAlignment: Text .AlignHCenter
Original file line number Diff line number Diff line change @@ -35,23 +35,27 @@ TesseractAPI::TesseractAPI(QObject *parent) :
35
35
36
36
info_ = Info ();
37
37
cancel_ = false ;
38
+ run_at_least_once_ = false ;
38
39
}
39
40
40
41
TesseractAPI::~TesseractAPI ()
41
42
{
42
- delete monitor_;
43
- monitor_ = 0 ;
44
43
delete settingsManager_;
45
44
settingsManager_ = 0 ;
46
45
delete downloadManager_;
47
46
downloadManager_ = 0 ;
48
47
delete timer_;
49
48
timer_ = 0 ;
49
+
50
50
delete PDFhandler_;
51
51
PDFhandler_ = 0 ;
52
- api_->End ();
53
- delete api_;
54
- api_ = 0 ;
52
+
53
+ delete monitor_;
54
+ monitor_ = 0 ;
55
+ if (run_at_least_once_) {
56
+ api_->End ();
57
+ api_ = 0 ;
58
+ }
55
59
}
56
60
57
61
void TesseractAPI::prepareForCropping (QString imagepath, int rotation, bool gallery) {
@@ -89,6 +93,7 @@ void TesseractAPI::analyze(QString imagepath, QVariant cropPoints)
89
93
// Periodically firing timer to get progress reports to the UI.
90
94
connect (timer_, SIGNAL (timeout ()), this , SLOT (update ()));
91
95
timer_->start (250 );
96
+ run_at_least_once_ = true ;
92
97
}
93
98
94
99
PDFThumbnailProvider *TesseractAPI::getThumbnailProvider () {
@@ -133,6 +138,7 @@ void TesseractAPI::analyzePDF(QList<int> pages)
133
138
// Periodically firing timer to get progress reports to the UI.
134
139
connect (timer_, SIGNAL (timeout ()), this , SLOT (update ()));
135
140
timer_->start (250 );
141
+ run_at_least_once_ = true ;
136
142
}
137
143
138
144
void TesseractAPI::cancel ()
Original file line number Diff line number Diff line change @@ -97,6 +97,7 @@ public slots:
97
97
QString rotatedPath_;
98
98
bool rotated_;
99
99
bool thumbsReady_;
100
+ bool run_at_least_once_;
100
101
unsigned int previousPage_;
101
102
102
103
ETEXT_DESC *monitor_;
You can’t perform that action at this time.
0 commit comments