"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/kdefrontend/datasources/ImportFileDialog.cpp" between
labplot-2.8.1.tar.gz and labplot-2.8.2.tar.gz

About: LabPlot is an application for plotting and analysis of 2D and 3D functions and data. It is a complete rewrite of LabPlot1 and lacks in the first release a lot of features available in the predecessor. On the other hand, the GUI and the usability is more superior.

ImportFileDialog.cpp  (labplot-2.8.1):ImportFileDialog.cpp  (labplot-2.8.2)
skipping to change at line 404 skipping to change at line 404
case LiveDataSource::SourceType::FileOrPipe: { case LiveDataSource::SourceType::FileOrPipe: {
DEBUG(" fileName = " << fileName.toUtf8().constData()); DEBUG(" fileName = " << fileName.toUtf8().constData());
const bool enable = QFile::exists(fileName); const bool enable = QFile::exists(fileName);
okButton->setEnabled(enable); okButton->setEnabled(enable);
if (enable) { if (enable) {
okButton->setToolTip(i18n("Close the dialog and import th e data.")); okButton->setToolTip(i18n("Close the dialog and import th e data."));
showErrorMessage(QString()); showErrorMessage(QString());
} else { } else {
QString msg = i18n("The provided file doesn't exist."); QString msg = i18n("The provided file doesn't exist.");
okButton->setToolTip(msg); okButton->setToolTip(msg);
showErrorMessage(msg);
//suppress the error widget when the dialog is opened the
first time.
//show only the error widget if the file was really a non
-existing file was provided.
if (!fileName.isEmpty())
showErrorMessage(msg);
} }
break; break;
} }
case LiveDataSource::SourceType::LocalSocket: { case LiveDataSource::SourceType::LocalSocket: {
const bool enable = QFile::exists(fileName); const bool enable = QFile::exists(fileName);
if (enable) { if (enable) {
QLocalSocket lsocket{this}; QLocalSocket lsocket{this};
DEBUG("CONNECT"); DEBUG("CONNECT");
lsocket.connectToServer(fileName, QLocalSocket::ReadOnly) ; lsocket.connectToServer(fileName, QLocalSocket::ReadOnly) ;
skipping to change at line 436 skipping to change at line 440
} else { } else {
okButton->setEnabled(false); okButton->setEnabled(false);
QString msg = i18n("Could not connect to the prov ided local socket. Error: %1.", lsocket.errorString()); QString msg = i18n("Could not connect to the prov ided local socket. Error: %1.", lsocket.errorString());
okButton->setToolTip(msg); okButton->setToolTip(msg);
showErrorMessage(msg); showErrorMessage(msg);
} }
} else { } else {
okButton->setEnabled(false); okButton->setEnabled(false);
QString msg = i18n("Could not connect to the provided loc al socket. The socket does not exist."); QString msg = i18n("Could not connect to the provided loc al socket. The socket does not exist.");
okButton->setToolTip(msg); okButton->setToolTip(msg);
showErrorMessage(msg); if (!fileName.isEmpty())
showErrorMessage(msg);
} }
break; break;
} }
case LiveDataSource::SourceType::NetworkTcpSocket: { case LiveDataSource::SourceType::NetworkTcpSocket: {
const bool enable = !m_importFileWidget->host().isEmpty() && !m_i mportFileWidget->port().isEmpty(); const bool enable = !m_importFileWidget->host().isEmpty() && !m_i mportFileWidget->port().isEmpty();
if (enable) { if (enable) {
QTcpSocket socket(this); QTcpSocket socket(this);
socket.connectToHost(m_importFileWidget->host(), m_import FileWidget->port().toUShort(), QTcpSocket::ReadOnly); socket.connectToHost(m_importFileWidget->host(), m_import FileWidget->port().toUShort(), QTcpSocket::ReadOnly);
if (socket.waitForConnected()) { if (socket.waitForConnected()) {
 End of changes. 2 change blocks. 
2 lines changed or deleted 9 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)