| 78 if (isOnForeground()) |
78 if (isOnForeground()) |
| 79 { |
79 { |
| 80 // Show a progress dialog if we're loading the main ldDocument.here so we can show progress updates and keep the |
80 // Show a progress dialog if we're loading the main ldDocument.here so we can show progress updates and keep the |
| 81 // WM posted that we're still here. |
81 // WM posted that we're still here. |
| 82 m_progressDialog = new OpenProgressDialog(qobject_cast<QWidget*>(parent())); |
82 m_progressDialog = new OpenProgressDialog(qobject_cast<QWidget*>(parent())); |
| 83 m_progressDialog->setNumLines (m_lines.size()); |
83 m_progressDialog->setNumLines (length(m_lines)); |
| 84 m_progressDialog->setModal (true); |
84 m_progressDialog->setModal (true); |
| 85 m_progressDialog->show(); |
85 m_progressDialog->show(); |
| 86 connect (this, SIGNAL (workDone()), m_progressDialog, SLOT (accept())); |
86 connect (this, SIGNAL (workDone()), m_progressDialog, SLOT (accept())); |
| 87 connect (m_progressDialog, SIGNAL (rejected()), this, SLOT (abort())); |
87 connect (m_progressDialog, SIGNAL (rejected()), this, SLOT (abort())); |
| 88 } |
88 } |
| 107 } |
107 } |
| 108 |
108 |
| 109 // Parse up to 200 lines per iteration |
109 // Parse up to 200 lines per iteration |
| 110 int max = i + 200; |
110 int max = i + 200; |
| 111 |
111 |
| 112 for (; i < max and i < (int) m_lines.size(); ++i) |
112 for (; i < max and i < (int) length(m_lines); ++i) |
| 113 { |
113 { |
| 114 QString line = m_lines[i]; |
114 QString line = m_lines[i]; |
| 115 |
115 |
| 116 // Trim the trailing newline |
116 // Trim the trailing newline |
| 117 while (line.endsWith ("\n") or line.endsWith ("\r")) |
117 while (line.endsWith ("\n") or line.endsWith ("\r")) |