Commit ee0e48af authored by Jasem Mutlaq's avatar Jasem Mutlaq
Browse files

Fixing the code after -DQT_NO_URL_CAST_FROM_STRING was added earliar

parent 72e85bea
......@@ -54,7 +54,7 @@ Align::Align()
new AlignAdaptor(this);
QDBusConnection::sessionBus().registerObject("/KStars/Ekos/Align", this);
dirPath = QDir::homePath();
dirPath = QUrl(QDir::homePath());
currentCCD = NULL;
currentTelescope = NULL;
......@@ -1588,7 +1588,7 @@ void Align::loadAndSlew(QUrl fileURL)
if (fileURL.isEmpty())
return;
dirPath = fileURL.path().remove(fileURL.fileName());
dirPath = QUrl(fileURL.url(QUrl::RemoveFilename));
loadSlewMode = true;
loadSlewState=IPS_BUSY;
......
......@@ -450,7 +450,7 @@ private:
// Track which upload mode the CCD is set to. If set to UPLOAD_LOCAL, then we need to switch it to UPLOAD_CLIENT in order to do focusing, and then switch it back to UPLOAD_LOCAL
ISD::CCD::UploadMode rememberUploadMode;
QString dirPath;
QUrl dirPath;
};
......
......@@ -56,7 +56,7 @@ Capture::Capture()
new CaptureAdaptor(this);
QDBusConnection::sessionBus().registerObject("/KStars/Ekos/Capture", this);
dirPath = QDir::homePath();
dirPath = QUrl(QDir::homePath());
currentCCD = NULL;
currentTelescope = NULL;
......@@ -1827,7 +1827,7 @@ void Capture::syncTelescopeInfo()
void Capture::saveFITSDirectory()
{
QString dir = QFileDialog::getExistingDirectory(KStars::Instance(), i18n("FITS Save Directory"), dirPath);
QString dir = QFileDialog::getExistingDirectory(KStars::Instance(), i18n("FITS Save Directory"), dirPath.path());
if (dir.isEmpty())
return;
......@@ -1838,7 +1838,7 @@ void Capture::saveFITSDirectory()
void Capture::loadSequenceQueue()
{
QUrl fileURL = QFileDialog::getOpenFileName(KStars::Instance(), i18n("Open Ekos Sequence Queue"), dirPath, "Ekos Sequence Queue (*.esq)");
QUrl fileURL = QFileDialog::getOpenFileUrl(KStars::Instance(), i18n("Open Ekos Sequence Queue"), dirPath, "Ekos Sequence Queue (*.esq)");
if (fileURL.isEmpty())
return;
......@@ -1849,7 +1849,7 @@ void Capture::loadSequenceQueue()
return;
}
dirPath = fileURL.path().remove(fileURL.fileName());
dirPath = QUrl(fileURL.url(QUrl::RemoveFilename));
}
......@@ -2133,7 +2133,7 @@ void Capture::saveSequenceQueue()
if (sequenceURL.isEmpty())
{
sequenceURL = QFileDialog::getSaveFileName(KStars::Instance(), i18n("Save Ekos Sequence Queue"), dirPath, "Ekos Sequence Queue (*.esq)");
sequenceURL = QFileDialog::getSaveFileUrl(KStars::Instance(), i18n("Save Ekos Sequence Queue"), dirPath, "Ekos Sequence Queue (*.esq)");
// if user presses cancel
if (sequenceURL.isEmpty())
{
......@@ -2141,7 +2141,7 @@ void Capture::saveSequenceQueue()
return;
}
dirPath = sequenceURL.path().remove(sequenceURL.fileName());
dirPath = QUrl(sequenceURL.url(QUrl::RemoveFilename));
if (sequenceURL.path().contains('.') == 0)
sequenceURL.setPath(sequenceURL.path() + ".esq");
......
......@@ -510,7 +510,7 @@ private:
// File HFR
double fileHFR;
QString dirPath;
QUrl dirPath;
// Misc
bool ignoreJobProgress;
......
......@@ -70,7 +70,7 @@ Scheduler::Scheduler()
new SchedulerAdaptor(this);
QDBusConnection::sessionBus().registerObject("/KStars/Ekos/Scheduler", this);
dirPath = QDir::homePath();
dirPath = QUrl(QDir::homePath());
state = SCHEDULER_IDLE;
ekosState = EKOS_IDLE;
indiState = INDI_IDLE;
......@@ -306,7 +306,7 @@ void Scheduler::selectFITS()
if (fitsURL.isEmpty())
return;
dirPath = fitsURL.path().remove(fitsURL.fileName());
dirPath = QUrl(fitsURL.url(QUrl::RemoveFilename));
setDirty();
......@@ -328,7 +328,7 @@ void Scheduler::selectSequence()
if (sequenceURL.isEmpty())
return;
dirPath = sequenceURL.path().remove(sequenceURL.fileName());
dirPath = QUrl(sequenceURL.url(QUrl::RemoveFilename));
setDirty();
......@@ -346,11 +346,11 @@ void Scheduler::selectSequence()
void Scheduler::selectStartupScript()
{
startupScriptURL = QFileDialog::getOpenFileUrl(this, i18n("Select Startup Script"), QDir::homePath(), i18n("Script (*)"));
startupScriptURL = QFileDialog::getOpenFileUrl(this, i18n("Select Startup Script"), dirPath, i18n("Script (*)"));
if (startupScriptURL.isEmpty())
return;
dirPath = startupScriptURL.path().remove(startupScriptURL.fileName());
dirPath = QUrl(startupScriptURL.url(QUrl::RemoveFilename));
mDirty=true;
startupScript->setText(startupScriptURL.path());
......@@ -358,11 +358,11 @@ void Scheduler::selectStartupScript()
void Scheduler::selectShutdownScript()
{
shutdownScriptURL = QFileDialog::getOpenFileUrl(this, i18n("Select Shutdown Script"), QDir::homePath(), i18n("Script (*)"));
shutdownScriptURL = QFileDialog::getOpenFileUrl(this, i18n("Select Shutdown Script"), dirPath, i18n("Script (*)"));
if (shutdownScriptURL.isEmpty())
return;
dirPath = shutdownScriptURL.path().remove(shutdownScriptURL.fileName());
dirPath = QUrl(shutdownScriptURL.url(QUrl::RemoveFilename));
mDirty=true;
shutdownScript->setText(shutdownScriptURL.path());
......@@ -2921,7 +2921,7 @@ void Scheduler::stopCurrentJobAction()
void Scheduler::load()
{
QUrl fileURL = QFileDialog::getOpenFileName(this, i18n("Open Ekos Scheduler List"), QDir::homePath(), "Ekos Scheduler List (*.esl)");
QUrl fileURL = QFileDialog::getOpenFileUrl(this, i18n("Open Ekos Scheduler List"), dirPath, "Ekos Scheduler List (*.esl)");
if (fileURL.isEmpty())
return;
......@@ -3188,7 +3188,7 @@ void Scheduler::save()
if (schedulerURL.isEmpty())
{
schedulerURL = QFileDialog::getSaveFileName(this, i18n("Save Ekos Scheduler List"), dirPath, "Ekos Scheduler List (*.esl)");
schedulerURL = QFileDialog::getSaveFileUrl(this, i18n("Save Ekos Scheduler List"), dirPath, "Ekos Scheduler List (*.esl)");
// if user presses cancel
if (schedulerURL.isEmpty())
{
......@@ -3196,7 +3196,7 @@ void Scheduler::save()
return;
}
dirPath = schedulerURL.path().remove(schedulerURL.fileName());
dirPath = QUrl(schedulerURL.url(QUrl::RemoveFilename));
if (schedulerURL.path().contains('.') == 0)
schedulerURL.setPath(schedulerURL.path() + ".esl");
......
......@@ -550,7 +550,7 @@ private:
QTimer schedulerTimer; // To call checkStatus
QTimer jobTimer; // To call checkJobStage
QString dirPath;
QUrl dirPath;
};
......
......@@ -146,10 +146,9 @@ void StreamWG::newFrame(IBLOB *bp)
void StreamWG::captureImage()
{
QString fname;
QString fmt;
QUrl currentFileURL;
QString currentDir = Options::fitsDir();
QUrl currentDir(Options::fitsDir());
QTemporaryFile tmpfile;
tmpfile.open();
......@@ -161,33 +160,7 @@ void StreamWG::captureImage()
if ( currentFileURL.isValid() )
{
//currentDir = currentFileURL.path();
/*if ( currentFileURL.isLocalFile() )
fname = currentFileURL.path();
else
fname = tmpfile.fileName();
if (fname.right(fmt.length()).toLower() != fmt.toLower())
{
fname += '.';
fname += fmt.toLower();
}*/
streamFrame->kPix.save(currentFileURL.path(), fmt.toLatin1());
//set rwx for owner, rx for group, rx for other
/*chmod( fname.toLatin1(), S_IRUSR|S_IWUSR|S_IXUSR|S_IRGRP|S_IXGRP|S_IROTH|S_IXOTH );
if ( tmpfile.fileName() == fname )
{ //need to upload to remote location
if ( ! KIO::NetAccess::upload( tmpfile.fileName(), currentFileURL, (QWidget*) 0 ) )
{
QString message = i18n( "Could not upload image to remote location: %1", currentFileURL.prettyUrl() );
KMessageBox::sorry( 0, message, i18n( "Could not upload file" ) );
}
}*/
streamFrame->kPix.save(currentFileURL.path(), fmt.toLatin1());
}
else
{
......
......@@ -12,7 +12,7 @@
<arg type="b" direction="out"/>
</method>
<method name="loadAndSlew">
<arg name="fileURL" type="s" direction="in"/>
<arg name="fileURL" type="QUrl" direction="in"/>
<annotation name="org.qtproject.QtDBus.QtTypeName.In0" value="QUrl"/>
<annotation name="org.freedesktop.DBus.Method.NoReply" value="true"/>
</method>
......
......@@ -18,12 +18,12 @@
</method>
<method name="loadSequenceQueue">
<arg type="b" direction="out"/>
<arg name="fileURL" type="s" direction="in"/>
<arg name="fileURL" type="QUrl" direction="in"/>
<annotation name="org.qtproject.QtDBus.QtTypeName.In0" value="QUrl"/>
</method>
<method name="isSequenceFileComplete">
<arg type="b" direction="out"/>
<arg name="fileURL" type="s" direction="in"/>
<arg name="fileURL" type="QUrl" direction="in"/>
<annotation name="org.qtproject.QtDBus.QtTypeName.In0" value="QUrl"/>
</method>
<method name="clearSequenceQueue">
......
......@@ -8,7 +8,7 @@
<annotation name="org.freedesktop.DBus.Method.NoReply" value="true"/>
</method>
<method name="loadScheduler">
<arg name="fileURL" type="s" direction="in"/>
<arg name="fileURL" type="QUrl" direction="in"/>
<arg type="b" direction="out"/>
<annotation name="org.qtproject.QtDBus.QtTypeName.In0" value="QUrl"/>
</method>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment