MCPcopy Create free account
hub / github.com/MiniZinc/MiniZincIDE / loadLargeFile

Method loadLargeFile

MiniZincIDE/ide.cpp:552–576  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

550}
551
552void IDE::loadLargeFile(const QString &path, QWidget* parent)
553{
554 DMap::iterator it = documents.find(path);
555 if (it.value()->large) {
556 QFile file(path);
557 if (file.open(QFile::ReadOnly | QFile::Text)) {
558 QTextStream file_stream(&file);
559#if QT_VERSION < 0x060000
560 file_stream.setCodec("UTF-8");
561#endif
562 it.value()->td.setPlainText(file_stream.readAll());
563 it.value()->large = false;
564 it.value()->td.setModified(false);
565 QSet<CodeEditor*>::iterator ed = it.value()->editors.begin();
566 for (; ed != it.value()->editors.end(); ++ed) {
567 (*ed)->loadedLargeFile();
568 }
569 fsWatch.addPath(path);
570 } else {
571 QMessageBox::warning(parent, "MiniZinc IDE",
572 "Could not open file "+path,
573 QMessageBox::Ok);
574 }
575 }
576}
577
578void IDE::registerEditor(const QString& path, CodeEditor* ce)
579{

Callers 1

loadContentsMethod · 0.80

Calls 6

findMethod · 0.80
setModifiedMethod · 0.80
loadedLargeFileMethod · 0.80
valueMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected