2525#include < QtCore/QLocale>
2626#include < QtCore/QProcess>
2727#include < QtCore/QRegularExpression>
28- #include < QtCore/QTemporaryFile>
2928#include < QtGui/QFont>
3029#include < QtGui/QWindow>
3130#include < QtGui/QDesktopServices>
@@ -2345,21 +2344,22 @@ void MainWindow::varResend() {
23452344}
23462345
23472346void MainWindow::varClipboardListToL1 () {
2348- const QString cbStr = qApp->clipboard ()->text ().replace (" " , " " ).trimmed ();
2347+ QString cbStr = qApp->clipboard ()->text ().replace (" " , " " ).trimmed ();
2348+ while (cbStr.endsWith (' ,' ))
2349+ {
2350+ cbStr.chop (1 );
2351+ cbStr = cbStr.trimmed ();
2352+ }
2353+
23492354 if (cbStr.isEmpty ()) {
23502355 QMessageBox::warning (this , MSG_WARNING, tr (" Empty clipboard" ));
23512356 return ;
23522357 }
23532358
2354- QTemporaryFile tempFile{" CEmu_temp_list_XXXXXX.8xl" };
2355- if (!tempFile.open ()) {
2356- QMessageBox::warning (this , MSG_ERROR, tr (" Could not create temporary file" ));
2357- return ;
2358- }
2359+ const QString tempFilePath = QDir::tempPath () + QDir::separator () + QStringLiteral (" CEmu_temp_listl1.8xl" );
23592360
23602361 ui->buttonClipboardListToL1 ->setEnabled (false );
23612362
2362- const QString tempFilePath = tempFile.fileName ();
23632363 bool ok = false ;
23642364
23652365 try
@@ -2381,6 +2381,7 @@ void MainWindow::varClipboardListToL1() {
23812381 }
23822382 }
23832383
2384+ QFile::remove (tempFilePath);
23842385 ui->buttonClipboardListToL1 ->setEnabled (true );
23852386}
23862387
0 commit comments