forked from qt-creator/qt-creator
Use native separator and make the line not wrap in the table view.
Reviewed-by: ck
This commit is contained in:
@@ -151,10 +151,12 @@ QVariantMap MaemoPackageContents::toMap() const
|
||||
QVariantMap map;
|
||||
map.insert(MODIFIED_KEY, m_modified);
|
||||
map.insert(REMOTE_EXE_KEY, m_remoteExecutableFilePath);
|
||||
|
||||
QDir dir;
|
||||
QStringList localFiles;
|
||||
QStringList remoteFiles;
|
||||
foreach (const Deployable &p, m_deployables) {
|
||||
localFiles << p.localFilePath;
|
||||
localFiles << dir.fromNativeSeparators(p.localFilePath);
|
||||
remoteFiles << p.remoteFilePath;
|
||||
}
|
||||
map.insert(LOCAL_FILES_KEY, localFiles);
|
||||
@@ -170,9 +172,13 @@ void MaemoPackageContents::fromMap(const QVariantMap &map)
|
||||
const QStringList remoteFiles = map.value(REMOTE_FILES_KEY).toStringList();
|
||||
if (localFiles.count() != remoteFiles.count())
|
||||
qWarning("%s: serialized data inconsistent", Q_FUNC_INFO);
|
||||
|
||||
QDir dir;
|
||||
const int count = qMin(localFiles.count(), remoteFiles.count());
|
||||
for (int i = 0; i < count; ++i)
|
||||
m_deployables << Deployable(localFiles.at(i), remoteFiles.at(i));
|
||||
for (int i = 0; i < count; ++i) {
|
||||
m_deployables << Deployable(dir.toNativeSeparators(localFiles.at(i)),
|
||||
remoteFiles.at(i));
|
||||
}
|
||||
}
|
||||
|
||||
QString MaemoPackageContents::remoteExecutableFilePath() const
|
||||
|
||||
@@ -64,6 +64,7 @@ MaemoPackageCreationWidget::MaemoPackageCreationWidget(MaemoPackageCreationStep
|
||||
m_ui(new Ui::MaemoPackageCreationWidget)
|
||||
{
|
||||
m_ui->setupUi(this);
|
||||
m_ui->packageContentsView->setWordWrap(false);
|
||||
m_ui->packageContentsView->setModel(step->packageContents());
|
||||
setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
|
||||
connect(step->packageContents(), SIGNAL(dataChanged(QModelIndex,QModelIndex)),
|
||||
@@ -103,7 +104,8 @@ void MaemoPackageCreationWidget::addFile()
|
||||
if (localFile.isEmpty())
|
||||
return;
|
||||
const MaemoPackageContents::Deployable
|
||||
deployable(QFileInfo(localFile).absoluteFilePath(), "/");
|
||||
deployable(QDir::toNativeSeparators(QFileInfo(localFile).absoluteFilePath()),
|
||||
"/");
|
||||
MaemoPackageContents * const contents = m_step->packageContents();
|
||||
if (!contents->addDeployable(deployable)) {
|
||||
QMessageBox::information(this, tr("File already in package"),
|
||||
|
||||
Reference in New Issue
Block a user