mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2024-11-23 12:48:40 -05:00
Fix a longstanding bug in "on_addButton_clicked()".
git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@4647 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
parent
5c5283552a
commit
1e59bdf367
@ -2150,26 +2150,23 @@ void MainWindow::on_addButton_clicked() //Add button
|
||||
msgBox("Cannot open \"" + f2.fileName () + "\".");
|
||||
return;
|
||||
}
|
||||
QTextStream in(&f1);
|
||||
QTextStream out(&f2);
|
||||
QTextStream in(&f1); //Read from CALL3.TXT
|
||||
QTextStream out(&f2); //Copy into CALL3.TMP
|
||||
QString hc=hisCall;
|
||||
QString hc1="";
|
||||
QString hc2="AAAAAA";
|
||||
QString hc2="000000";
|
||||
QString s;
|
||||
do {
|
||||
s=in.readLine();
|
||||
hc1=hc2;
|
||||
if(s.mid(0,2)=="//") {
|
||||
out << s + "\n";
|
||||
out << s + "\n"; //Copy all comment lines
|
||||
} else {
|
||||
int i1=s.indexOf(",");
|
||||
hc2=s.mid(0,i1);
|
||||
if(hc>hc1 && hc<hc2) {
|
||||
out << newEntry + "\n";
|
||||
if(s.mid(0,6)=="ZZZZZZ") {
|
||||
out << s + "\n";
|
||||
// exit; //Statement has no effect!
|
||||
}
|
||||
out << s + "\n";
|
||||
m_call3Modified=true;
|
||||
} else if(hc==hc2) {
|
||||
QString t=s + "\n\n is already in CALL3.TXT\n" +
|
||||
@ -2187,9 +2184,7 @@ void MainWindow::on_addButton_clicked() //Add button
|
||||
} while(!s.isNull());
|
||||
|
||||
f1.close();
|
||||
if(hc>hc1 && !m_call3Modified) {
|
||||
out << newEntry + "\n";
|
||||
}
|
||||
if(hc>hc1 && !m_call3Modified) out << newEntry + "\n";
|
||||
if(m_call3Modified) {
|
||||
QDir data_path {m_config.data_path ()};
|
||||
QFile f0(data_path.absoluteFilePath ("CALL3.OLD"));
|
||||
|
Loading…
Reference in New Issue
Block a user