Changeset 388377b in OpenModelica for OMEdit/OMEditLIB/MainWindow.cpp
- Timestamp:
- 2023-03-24T14:56:17+01:00 (14 months ago)
- Children:
- a498414e
- Parents:
- c84168c
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
OMEdit/OMEditLIB/MainWindow.cpp
r7f0681b2 r388377b 408 408 } 409 409 410 /*! 411 * \brief MainWindow::setNewApiProfiling 412 * Sets the new api profiling flag. 413 * If flag is enabled then creates a file for it. 414 * \param newApiProfiling 415 */ 416 void MainWindow::setNewApiProfiling(bool newApiProfiling) 417 { 418 mNewApiProfiling = newApiProfiling; 419 if (mNewApiProfiling) { 420 QString& tmpPath = Utilities::tempDirectory(); 421 /* create a file to write OMEdit communication log */ 422 QString profilingFilePath = QString("%1instanceApiProfiling.txt").arg(tmpPath); 423 #ifdef Q_OS_WIN 424 mpNewApiProfilingFile = _wfopen((wchar_t*)profilingFilePath.utf16(), L"w"); 425 #else 426 mpNewApiProfilingFile = fopen(profilingFilePath.toUtf8().constData(), "w"); 427 #endif 428 } 429 } 430 410 431 #if !defined(WITHOUT_OSG) 411 432 /*! … … 678 699 // delete the searchwidget object to call the destructor, to cancel the search operation running on seperate thread 679 700 delete mpSearchWidget; 701 // if new api profiling file is open then close it. 702 if (mpNewApiProfilingFile) { 703 fclose(mpNewApiProfilingFile); 704 } 680 705 } 681 706 … … 1538 1563 { 1539 1564 return QString("%1/.openmodelica/libraries/index.json").arg(Helper::userHomeDirectory); 1565 } 1566 1567 /*! 1568 * \brief MainWindow::writeNewApiProfiling 1569 * Writes to new api profiling file. 1570 * \param str 1571 */ 1572 void MainWindow::writeNewApiProfiling(const QString &str) 1573 { 1574 if (mpNewApiProfilingFile) { 1575 fputs(QString("%1\n").arg(str).toUtf8().constData(), mpNewApiProfilingFile); 1576 fflush(mpNewApiProfilingFile); 1577 } 1540 1578 } 1541 1579
Note: See TracChangeset
for help on using the changeset viewer.