forked from teamnwah/openmw-tes3coop
Fixed non-loading files
This commit is contained in:
parent
217a4d75b4
commit
4c72a9ffdf
4 changed files with 11 additions and 7 deletions
|
@ -128,6 +128,9 @@ void CS::Editor::openFiles()
|
|||
files.push_back(path.toStdString());
|
||||
}
|
||||
|
||||
foreach (const boost::filesystem::path fp, files)
|
||||
qDebug() << "loading files: " << fp.c_str();
|
||||
|
||||
/// \todo Get the save path from the file dialogue
|
||||
CSMDoc::Document *document = mDocumentManager.addDocument (files, *files.rbegin(), false);
|
||||
|
||||
|
|
|
@ -44,7 +44,7 @@ QStringList CSVDoc::FileDialog::selectedFilePaths()
|
|||
foreach (ContentSelectorModel::EsmFile *file, ContentSelectorView::ContentSelector::
|
||||
instance().selectedFiles() )
|
||||
{
|
||||
filePaths.append(file->fileName());
|
||||
filePaths.append(file->path());
|
||||
}
|
||||
return filePaths;
|
||||
}
|
||||
|
|
|
@ -15,10 +15,10 @@ ContentSelectorModel::ContentModel::ContentModel(QObject *parent) :
|
|||
mDefaultFlags (Qt::ItemIsDropEnabled | Qt::ItemIsSelectable),
|
||||
mDropActions (Qt::CopyAction | Qt::MoveAction)
|
||||
{
|
||||
// setEncoding ("win1252");
|
||||
setEncoding ("win1252");
|
||||
uncheckAll();
|
||||
}
|
||||
/*
|
||||
|
||||
void ContentSelectorModel::ContentModel::setEncoding(const QString &encoding)
|
||||
{
|
||||
if (encoding == QLatin1String("win1252"))
|
||||
|
@ -33,7 +33,7 @@ void ContentSelectorModel::ContentModel::setEncoding(const QString &encoding)
|
|||
else
|
||||
return; // This should never happen;
|
||||
}
|
||||
*/
|
||||
|
||||
int ContentSelectorModel::ContentModel::columnCount(const QModelIndex &parent) const
|
||||
{
|
||||
if (parent.isValid())
|
||||
|
@ -420,8 +420,9 @@ void ContentSelectorModel::ContentModel::addFiles(const QString &path)
|
|||
|
||||
try {
|
||||
ESM::ESMReader fileReader;
|
||||
ToUTF8::Utf8Encoder encoder(); //ToUTF8::calculateEncoding(QString(mCodec->name()).toStdString()));
|
||||
//fileReader.setEncoder(&encoder);
|
||||
ToUTF8::Utf8Encoder encoder =
|
||||
ToUTF8::calculateEncoding(QString(mCodec->name()).toStdString());
|
||||
fileReader.setEncoder(&encoder);
|
||||
fileReader.open(dir.absoluteFilePath(path).toStdString());
|
||||
|
||||
foreach (const ESM::Header::MasterData &item, fileReader.getGameFiles())
|
||||
|
|
|
@ -22,7 +22,7 @@ namespace ContentSelectorModel
|
|||
public:
|
||||
explicit ContentModel(QObject *parent = 0);
|
||||
|
||||
//void setEncoding(const QString &encoding);
|
||||
void setEncoding(const QString &encoding);
|
||||
|
||||
int rowCount(const QModelIndex &parent = QModelIndex()) const;
|
||||
int columnCount(const QModelIndex &parent = QModelIndex()) const;
|
||||
|
|
Loading…
Reference in a new issue