Skip to content

Commit 38c3cea

Browse files
author
Ole Liabø
committed
Fix for large journals.
1 parent 5092ff3 commit 38c3cea

File tree

5 files changed

+33
-6
lines changed

5 files changed

+33
-6
lines changed

formats/nha-sip.conf

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,3 +49,6 @@ INFOVIEW_AUTO_IMPORT_REGEXP_NN=filename[^.*avlxml\\.xml$]
4949
INFOVIEW_FOLDER_TYPE_REGEXP_EN=reportsFolder
5050
INFOVIEW_FOLDER_TYPE_REGEXP_NB=rapportMappe
5151
INFOVIEW_FOLDER_TYPE_REGEXP_NN=rapportMappe
52+
53+
; Auto collapse nodes will be collapsed when importing XML
54+
TREEVIEW_AUTO_COLLAPSE_REGEXP=derivater@objekter@metadata

pdf/combine-pdfs.cmd

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
@echo off
2+
3+
setlocal EnableDelayedExpansion
4+
5+
set FOLDER=%1
6+
set FILES=%2
7+
set OUT=%3
8+
set convertlog=%4
9+
10+
pushd %FOLDER%
11+
pdftk %FILES% cat output %OUT% >> %convertlog%
12+
if not %ERRORLEVEL% equ 0 (
13+
echo ERROR executing pdftk %FILES% cat output %OUT% >> %convertlog%
14+
exit /b 1
15+
)
16+
popd
17+
18+
endlocal

pdf/create-pdf.cmd

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,9 @@ if not exist %HOCR_SCRIPT% (
4747
)
4848

4949

50+
del /q %temp%\journal_*pdf
5051
set output=%temp%\journal_%timestamp%
52+
5153
set pdffiles=%temp%\journal_pages_%timestamp%.txt
5254
set n=0
5355
FOR /F "tokens=1,2 delims=;" %%i in (%files%) do (
@@ -62,9 +64,9 @@ FOR /F "tokens=1,2 delims=;" %%i in (%files%) do (
6264
set /A n+=1
6365
)
6466

65-
pdftk %pdfs% output %out%
67+
call combine-pdfs.cmd %temp% journal_%timestamp%_*.pdf %out% %convertlog%
6668
if not %ERRORLEVEL% equ 0 (
67-
echo ERROR executing pdftk %pdfs% output %out% >> %convertlog%
69+
echo ERROR executing combine-pdfs.cmd %temp% journal_%timestamp%_*.pdf %out% >> %convertlog%
6870
exit /b 1
6971
)
7072
endlocal

src/gui/dinsightmainwindow.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -620,9 +620,10 @@ void DInsightMainWindow::importFileFinished( bool ok )
620620
infoMessage = tr("Import complete!");
621621
}
622622

623-
if ( m_CurrentImport->GetReportFormat()->autoCollapseRegExp().size() )
623+
const DImportFormat* format = m_ImportFormats->find( m_CurrentImport->formatName() );
624+
if ( format->autoCollapseRegExp().size() )
624625
{
625-
m_Ui.treeView->collapseRecursive( m_CurrentImport->root(), m_CurrentImport->GetReportFormat()->autoCollapseRegExp() );
626+
m_Ui.treeView->collapseRecursive( m_CurrentImport->root(), format->autoCollapseRegExp() );
626627
}
627628
else
628629
{

src/main.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -251,8 +251,11 @@ int main( int argc, char* argv[] )
251251
window.importFile( parser.value( fileOption ), parser.value( fileFormatOption ), parser.value( autoExportOption ) );
252252
}
253253

254-
// Start GUI
255-
window.show();
254+
if ( !parser.isSet( autoExportOption ) )
255+
{
256+
// Start GUI
257+
window.show();
258+
}
256259

257260
return qtApp.exec();
258261
}

0 commit comments

Comments
 (0)